views:

27

answers:

1

I am learning building php unit tests using PHPUnit . There they have a manual and I encountered this example Where they use assertEmpty(), but when I run this code in command line I get this error : Call to undefined method StackTest::assertEmpty() in /var/www/.../tests/StackTest.php on line 20. So if this method is deprecated or something why they use it , also is there another method for this? (of course I can try this $this->assertEquals(0, count($stack));) but anyways... The same with assertNotEmpty().

+1  A: 

Are you running the unit test from the command line with the phpunit command line tools?

phpunit --verbose StackTest stacktest.php
Craig
Yes, and you command is giving additionally the class name , nothing else :(...
Centurion
Any luck yet? Perhaps just go with 'phpunit name_of_your_file.php'
Craig