So I have manually installed PHPUnit by downloading the files from pear.phpunit.de and extracting them to C:\PHP\PEAR folder. I have the PEAR folder in include path. How can I run this test?
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);
}
}
There is no executable command line tool in the PHPUnit directory.
On my machine,
phpunit.batwas added in my main php install directory. I run tests by callingin the directory containing the test.
The batch file simply invokes main php interpreter passing
phpunitas the source file and appending other arguments to its invocation. If you don’t have the batch file, try running