Top "Phpunit" questions

PHPUnit is a programmer-oriented testing framework for PHP.

PHPUnit - Mocking a trait

I have a trait that is used by multiple classes, i.e class SomeClass { use TimeoutTrait; function handle() { $this->…

php phpunit prophecy
What is .phpunit.result.cache

When I run tests with PhpUnit on a new package I'm creating for Laravel, it generates the file .phpunit.result.…

laravel unit-testing laravel-5 phpunit
Trait not found inside Laravel 5 unit tests

I'm writing some unit tests to test the API endpoints in my Laravel 5 application, and a lot of endpoints require …

php composer-php phpunit autoload
Using Spy Object in PHPUnit?

How can I use Spy Object in PHPUnit? You can call object in imitation on, and after you can assert …

php phpunit spy
test command symfony with phpunit

I create some basic command with symfony3.2 to generate some newsletter periodically I'm dealing with some issue when i want …

php symfony phpunit symfony-3.2
PHPUnit output causing Zend_Session exceptions

I am getting numerous errors exactly like this one: Zend_Session_Exception: Session must be started before any output has …

php zend-framework phpunit zend-session
Failed to download pear/HTTP_Request2 within preferred state "stable"

When trying to do pear install phpunit/PHPUnit I get the following error Failed to download pear/HTTP_Request2 within …

phpunit pear httprequest
Test Queue functionality?

According to the Laravel Documentation, I can use Queue::fake(); prevent jobs from being queued. What is not clear how …

php laravel phpunit mockery laravel-testing
How do I write unit tests in PHP with a procedural codebase?

I'm mostly convinced of the benefits of unit testing, and I would like to start applying the concept to a …

php unit-testing phpunit simpletest paradigms