Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit - does nothing, no errors, no output

Tags:

phpunit

Sorry for another 'phpunit doesn't work' question. It used to work for years now. Today I reinstalled PEAR and phpunit for reasons not connected to this problem. Now when I run phpunit as I usually did. Nothing happens. The cli just shows me a new line, no output whatsoever.

Has anyone encountered this problem or has an idea what could have caused it.

PHPUnit Version: 3.5.15  PEAR Version: 1.9.4  PHP Version: 5.3.8  Windows 7 
like image 486
markus Avatar asked Sep 18 '11 00:09

markus


People also ask

What is PHPUnit used for?

PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit design for unit testing systems that began with SUnit and became popular with JUnit. Even a small software development project usually takes hours of hard work.

What are PHPUnit fixtures?

Fixtures of a test involve writing a code to set the world up in a known state, and after the test, return it back to its original state. When testing array operations in PHPUnit, the array stored in the `$stack` variable is simply the fixture.

What is PHPUnit laravel?

Use Laravel Unit Testing to Avoid Project-Wrecking Mistakes. Pardeep Kumar. 7 Min Read. PHPUnit is one of the most well known and highly optimized unit testing packages of PHP. It is a top choice of many developers for rectifying different developmental loopholes of the application.


2 Answers

I'm on OSX and MAMP. To get error messages I had to adjust the following entries in php.ini:

display_errors = On display_startup_errors = On 

Please not that this has to go into /Applications/MAMP/bin/php/php5.3.6/conf/php.ini .

like image 192
BetaRide Avatar answered Oct 06 '22 05:10

BetaRide


For future reference, for those who are facing any problem with PHPUnit, and PHPUnit is failing silently, just add this three lines inside phpunit.xml:

<phpunit ....... >     ...     ...     <php>          <ini name="display_errors" value="true"/>     </php> </phpunit> 

After that run the tests again, and now you can see why PHPUnit is failing,

AND ... ENJOY UNIT TESTING :)

like image 37
Ahmad Hajjar Avatar answered Oct 06 '22 06:10

Ahmad Hajjar