I have run my laravel app with phpunit. Everything is fine until at some point when I run my test again turns out with this error. Illuminate\Database\QueryExce
everybody! I've finished a laravel project backend with postgres and it has a phpunit tests, everything it works. So, I did upload to Github. When I did "git
I used Symfony 5.2 and I need to mock service method which execute send request to stripe payment system, obviously don't need to execute it when tests executin
I used Symfony 5.2 and I need to mock service method which execute send request to stripe payment system, obviously don't need to execute it when tests executin
when I try to run my unit tests, I get this error PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: \xampp\php\ext\bz2 (The specifie
firstly I was receiving a warning and a fatal error. The warning: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue
I have this code: public function method(){ //... if(!$exist) { throw new \InvalidArgumentException('Ce client inexistant', 400); } } I do the UT
I tried find solution to my issue but didn't find anything. I use: Symfony, Doctrine, PhpUnit I have one entity class InvoiceNumerator: /** * InvoiceNumerat
I'm trying to test methods which requires Sessions in my PHPUnit WebTestCase, with no success. PHP 8.0, Symfony 5.4 Here's my code: When user log-in, I'm saving
I'm trying to make CI pipeline and run phpunit tests via GitHub actions. First of all: tests work fine on my local machine (mac os). Then, when I do git push my
I'm writing tests and I want to assert, that a returned collection has some specific structure. For asserting jsons I'm using assertJsonStructure() method on
I created a simple test for my new Laravel 7 application. But when I run php artisan test I get the following error. Target [Illuminate\Contracts\View\Factory]
I keep getting status 500 when 200 is expected. These are the files: ExampleTest.php namespace Tests\Feature; use Tests\TestCase; use Illuminate\Foundation\T
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