PHpUnit with xdebug Breaks at BaseTestRunner instead of the actual test

I have setup Xdebug remote debugging with the following configuration: I placed a breakpoint in my phpunit test:

How to assert 2 directories are identical in PHPunit?

I have 2 directories, multiple files, basically text formats. They should be equal. I need to know what files are missing/extra (diff will). What method should I use?

How to test a Symfony BinaryFileResponse with php-unit

I have written an action which create a temporary file and returned it with a BinaryFileResponse and delete it after. Something like this : $response = new BinaryFileResponse($this->getFile($…

Run one file or map in phpunit

I’m using laravel and I’ve written some test files. But how can I exec only one file? When I do for example: phpunit tests/resulttesting/school/deleteSchoolForRealTest It throws an error: Cannot …

PHPUnit: “Class ‘Eloquent’ not found” when using @dataProvider

I’m running into an issue when writing unit tests with PHPUnit using @dataProvider in a Laravel app. The error I’m receiving is: PHP Fatal error: Class ‘Eloquent’ not found in /path/to/project/app/…

PHPUnit assert no method is called

I have a ClassA that uses a ServiceB. In a certain case, ClassA should end up not invoking any methods of ServiceB. I now want to test this and verity no methods are indeed called. This can be done …

Non-testable base class extending PHPUnit_Framework_TestCase

Summary How can I create a base class that extends PHPUnit_Framework_TestCase and use that for subclassing actual test cases, without having the base class itself tested by PHPUnit? Further …

Calling php code from php code on different server

The situation is following. I have a local (development) PHP server (Win + IIS) on my computer and I would like to call a function on a remote server because there is an executable file on the remote …

PHP and unit testing assertions with decimals

I have a method that returns a float like 1.234567890.I want to test that it really does so. However, it seems that this returned float has different precision on different platforms so how do I …