add tests repository
This commit is contained in:
parent
53c1ae9e0c
commit
22c527fb32
32
tests/test.php
Normal file
32
tests/test.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
class StackTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testEmpty()
|
||||
{
|
||||
$stack = array();
|
||||
$this->assertEmpty($stack);
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testEmpty
|
||||
*/
|
||||
public function testPush(array $stack)
|
||||
{
|
||||
array_push($stack, 'foo');
|
||||
$this->assertEquals('foo', $stack[count($stack)-1]);
|
||||
$this->assertNotEmpty($stack);
|
||||
|
||||
return $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPush
|
||||
*/
|
||||
public function testPop(array $stack)
|
||||
{
|
||||
$this->assertEquals('foo', array_pop($stack));
|
||||
$this->assertEmpty($stack);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user