Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
DummyTest.php
Go to the documentation of this file.
1 <?php
2 /**
3  * This is a fake test for the purpose of showing how tests work and eventually
4  * validate the test environment works
5  *
6  * The following methods are available :
7  * assertArrayHasKey()
8  * assertClassHasAttribute()
9  * assertClassHasStaticAttribute()
10  * assertContains()
11  * assertContainsOnly()
12  * assertContainsOnlyInstancesOf()
13  * assertCount()
14  * assertEmpty()
15  * assertEqualXMLStructure()
16  * assertEquals()
17  * assertFalse()
18  * assertFileEquals()
19  * assertFileExists()
20  * assertGreaterThan()
21  * assertGreaterThanOrEqual()
22  * assertInstanceOf()
23  * assertInternalType()
24  * assertJsonFileEqualsJsonFile()
25  * assertJsonStringEqualsJsonFile()
26  * assertJsonStringEqualsJsonString()
27  * assertLessThan()
28  * assertLessThanOrEqual()
29  * assertNull()
30  * assertObjectHasAttribute()
31  * assertRegExp()
32  * assertStringMatchesFormat()
33  * assertStringMatchesFormatFile()
34  * assertSame()
35  * assertSelectCount()
36  * assertSelectEquals()
37  * assertSelectRegExp()
38  * assertStringEndsWith()
39  * assertStringEqualsFile()
40  * assertStringStartsWith()
41  * assertTag()
42  * assertThat()
43  * assertTrue()
44  * assertXmlFileEqualsXmlFile()
45  * assertXmlStringEqualsXmlFile()
46  * assertXmlStringEqualsXmlString()
47  */
48 class DummyTest extends AlterncTest
49 {
50  /**
51  * The setup is automatically run before each test
52  */
53  protected function setUp()
54  {
55  }
56 
57  /**
58  * The tearDown is automatically run after each test
59  */
60  protected function tearDown()
61  {
63  }
64 
65 
66 
67  /**
68  * This function will NOT be executed as its name doesn't start with test*
69  */
70  protected function notTested()
71  {
72 
73  }
74 
75  /**
76  * This function will be executed by methods
77  * @return boolean
78  */
79  public function testDependance()
80  {
81  $this->assertTrue(TRUE);
82  return TRUE;
83  }
84 
85  /**
86  * @depends testDependance
87  * @param bool $dependancyStatus Received from dependance return
88  */
89  public function testHasDependancy( $dependancyStatus)
90  {
91  $this->assertTrue($dependancyStatus);
92  }
93 
94 
95  public function testPushAndPop()
96  {
97  $stack = array();
98  $this->assertEquals(0, count($stack));
99 
100  array_push($stack, 'foo');
101  $this->assertEquals('foo', $stack[count($stack)-1]);
102  $this->assertEquals(1, count($stack));
103 
104  $this->assertEquals('foo', array_pop($stack));
105  $this->assertEquals(0, count($stack));
106  }
107 }
108