Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpunit is not working

I am trying to get phpunit to work on my ubuntu 11.10 installation. I have installed PHPUnit using PEAR, as suggested here and then I prepared a very small testing class:

error_reporting(E_ALL & ~E_DEPRECATED);
set_include_path(get_include_path().':/usr/share/php');
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Extensions/OutputTestCase.php';

class ExampleTest extends PHPUnit_Framework_TestCase
{
    public function testOne()
    {
        $this->assertTrue(FALSE);
    }
}
// $suite = new PHPUnit_Framework_TestSuite('ExampleTest');
// PHPUnit_TextUI_TestRunner::run($suite);

When I run this via the command line executable phpunit, I get nothing. When I uncomment the last two lines and run the file with the php executable, I get proper output (Failed asserting that is true. etc..)

Further more, when I try phpunit --version, I still get nothing!

Any ideas??

like image 397
dimi Avatar asked Aug 01 '26 06:08

dimi


1 Answers

I just figured it out...I forgot to add /usr/share/php in the include_path in php.ini. grrrrrr...

like image 149
dimi Avatar answered Aug 03 '26 20:08

dimi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!