2014-03-12 17:43:26 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This is a fake test for the purpose of showing how tests work and eventually
|
|
|
|
* validate the test environment works
|
|
|
|
*
|
|
|
|
* The following methods are available :
|
|
|
|
* assertArrayHasKey()
|
|
|
|
* assertClassHasAttribute()
|
|
|
|
* assertClassHasStaticAttribute()
|
|
|
|
* assertContains()
|
|
|
|
* assertContainsOnly()
|
|
|
|
* assertContainsOnlyInstancesOf()
|
|
|
|
* assertCount()
|
|
|
|
* assertEmpty()
|
|
|
|
* assertEqualXMLStructure()
|
|
|
|
* assertEquals()
|
|
|
|
* assertFalse()
|
|
|
|
* assertFileEquals()
|
|
|
|
* assertFileExists()
|
|
|
|
* assertGreaterThan()
|
|
|
|
* assertGreaterThanOrEqual()
|
|
|
|
* assertInstanceOf()
|
|
|
|
* assertInternalType()
|
|
|
|
* assertJsonFileEqualsJsonFile()
|
|
|
|
* assertJsonStringEqualsJsonFile()
|
|
|
|
* assertJsonStringEqualsJsonString()
|
|
|
|
* assertLessThan()
|
|
|
|
* assertLessThanOrEqual()
|
|
|
|
* assertNull()
|
|
|
|
* assertObjectHasAttribute()
|
|
|
|
* assertRegExp()
|
|
|
|
* assertStringMatchesFormat()
|
|
|
|
* assertStringMatchesFormatFile()
|
|
|
|
* assertSame()
|
|
|
|
* assertSelectCount()
|
|
|
|
* assertSelectEquals()
|
|
|
|
* assertSelectRegExp()
|
|
|
|
* assertStringEndsWith()
|
|
|
|
* assertStringEqualsFile()
|
|
|
|
* assertStringStartsWith()
|
|
|
|
* assertTag()
|
|
|
|
* assertThat()
|
|
|
|
* assertTrue()
|
|
|
|
* assertXmlFileEqualsXmlFile()
|
|
|
|
* assertXmlStringEqualsXmlFile()
|
|
|
|
* assertXmlStringEqualsXmlString()
|
|
|
|
*/
|
|
|
|
class DummyTest extends AlterncTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The setup is automatically run before each test
|
|
|
|
*/
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The tearDown is automatically run after each test
|
|
|
|
*/
|
|
|
|
protected function tearDown()
|
|
|
|
{
|
2014-03-22 14:45:07 +00:00
|
|
|
parent::tearDown();
|
2014-03-12 17:43:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function will NOT be executed as its name doesn't start with test*
|
|
|
|
*/
|
|
|
|
protected function notTested()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function will be executed by methods
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function testDependance()
|
|
|
|
{
|
2014-03-19 09:15:54 +00:00
|
|
|
$this->assertTrue(TRUE);
|
2014-03-12 17:43:26 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @depends testDependance
|
|
|
|
* @param bool $dependancyStatus Received from dependance return
|
|
|
|
*/
|
|
|
|
public function testHasDependancy( $dependancyStatus)
|
|
|
|
{
|
|
|
|
$this->assertTrue($dependancyStatus);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testPushAndPop()
|
|
|
|
{
|
|
|
|
$stack = array();
|
|
|
|
$this->assertEquals(0, count($stack));
|
|
|
|
|
|
|
|
array_push($stack, 'foo');
|
|
|
|
$this->assertEquals('foo', $stack[count($stack)-1]);
|
|
|
|
$this->assertEquals(1, count($stack));
|
|
|
|
|
|
|
|
$this->assertEquals('foo', array_pop($stack));
|
|
|
|
$this->assertEquals(0, count($stack));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|