I get phpunit and install it as this link using the simplest way for test purposes. I just download the phpunit.phar file, chmod & rename & move to /usr/local/bin Then, I run phpunit --version, its ok.
I write a simple php test case.
class SimpleTest extends PHPUnit_Framework_TestCase { public function testSomething(){ $this -> assertTrue(true); } }
In terminal , I go to my php class folder, and execute
phpunit --colors SimpleTest
Now I got the exceptions
PHP ReflectionException: Method suite does not exist in phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php on line 113 PHP Stack trace: PHP 1. {main}() /usr/local/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main($exit = *uninitialized*) /usr/local/bin/phpunit:612 PHP 3. PHPUnit_TextUI_Command->run($argv = array ( 0 => '/usr/local/bin/phpunit', 1 => '--colors', 2 => 'SimpleTest.php'), $exit = TRUE) phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:129 PHP 4. PHPUnit_Runner_BaseTestRunner->getTest( $suiteClassName = 'SimpleTest', $suiteClassFile = '/home/kevin/Workspace/php/laravel/app/tests/SimpleTest.php', $suffixes = array (0 => 'Test.php', 1 => '.phpt')) phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:150 PHP 5. ReflectionClass->getMethod('suite') phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php:113 PHPUnit 3.7.27 by Sebastian Bergmann.
Anything is welcome, thanks .