Top "Phpunit" questions

PHPUnit is a programmer-oriented testing framework for PHP.

How can I suppress PHPCS warnings using comments?

My TestMyClass.php has two class definitions in the same file (unit testing class), and PHP Code Sniffer complains about …

php phpunit phpcs
PHPUnit: Warning: require(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/local/bin/phpunit on line 42

when running phpunit I get error Warning: require(PHPUnit/Autoload.php): failed to open stream: No such file or directory …

phpunit osx-lion mamp
PHPUnit: Verifying that array has a key with given value

Given the following class: <?php class Example { private $Other; public function __construct ($Other) { $this->Other = $Other; } public function …

php phpunit
Test PHP headers with PHPUnit

I'm trying to use PHPunit to test a class that outputs some custom headers. The problem is that on my …

php unit-testing phpunit output-buffering
unit testing and Static methods

Reading up and picking up on unit testing, trying to make sense of the following post on that explains the …

php unit-testing phpunit
How can I get XDebug to run with PHPUnit on the CLI?

I've tried running the following CLI command: phpunit -d xdebug.profiler_enable=on XYZTestCase.php but it just runs as …

php phpunit command-line-interface xdebug
How to specify a different .env file for phpunit in Laravel 5?

I have a .env file containing my database connection details, as is normal for Laravel 5. I want to override these …

php laravel laravel-5 phpunit phpdotenv
Windows Installing PHPUnit via PEAR - Installing PHPUnit via PEAR

When I run: peardev install phpunit/PHPUnit I get the following: No releases available for package "pear.phpunit.de/PHPUnit" …

php phpunit pear
How to test a second parameter in a PHPUnit mock object

This is what I have: $observer = $this->getMock('SomeObserverClass', array('method')); $observer->expects($this->once()) ->…

php phpunit
Phpunit tests gives warning no tests found in class

I am trying to learn how to test with phpunit and laravel. When start the test using phpunit command, I …

php laravel phpunit