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()
.
views:
27answers:
1
+1
A:
Are you running the unit test from the command line with the phpunit command line tools?
phpunit --verbose StackTest stacktest.php
Craig
2010-10-06 02:46:39
Yes, and you command is giving additionally the class name , nothing else :(...
Centurion
2010-10-06 06:29:42
Any luck yet? Perhaps just go with 'phpunit name_of_your_file.php'
Craig
2010-10-07 14:35:03