I'm trying to use PHPUnit in a PHP project. Here is my project structure (files are in italic font style) controllers Pages.php tests pagesTest.php vendor
I'm trying to test a function that depends on $request->all(); in a method. How do I mock the Request class so $request->all(); returns ['includes' =
Is it allowed to return objects from @dataProviders to test methods? public function iOsMessages() { return [ 'update available' => [1,
I have just installed PHPUnit version 3.7.19 by Sebastian Bergmann via Composer and have written a class I would like to unit test. I would like to have all my
I am testing an parameter sent to a mocked event handler. The parameter is an object of "Event" sub-type, which itself has some data nested inside it. I want to
I have REST API written in php, i want to test it with phpunit. I wrote test like this, it works but response body was empty. I tested it with fiddler, it se
I am diving deeper and deeper in the world of unit testing. One issue I encountered, and this is where I would like feedback, is when one runs multiple test su
I'm working on tests for a Symfony2 project, and right now I'm looking for a way to create tests involving entity objects without persisting them. The problem i
I have chosen to use a Phar of PHPUnit (phpunit-4.8.26.phar) to unit test my custom built PHP Framework and Application. The reason I am using the old stable re
I've already read the documentation. Basically I've tried tests while following the BankAccount example. But I get errors: Warning: require_once(PHP/CodeCovera
Is it possible to create a mock object with disabled constructor and manually setted protected properties? Here is an idiotic example: class A { protected