laravel-testing Questions

4

Solved

I am using Laravel 8 and to test my app, I am running php artisan test --coverage-html reports The tests are running successfully. The problem is that there is no coverage reports generated. I hav...
Lala asked 30/3, 2021 at 18:11

1

Solved

where running all test php artisan test everything work as expected and all tests runs now , when i run signle test php artisan test --filter test_get_profile i get this wired error An error occur...
Pryer asked 3/6, 2023 at 16:20

5

Solved

$this->assertDatabaseHas() not working with JSON/JSONb columns. So how can I tests these types of columns in Laravel? Currently, I have a store action. How can I perform an assertion, that a ...
Archeology asked 6/5, 2018 at 18:16

1

I was writing a very basic test for a Laravel Artisan Console Command, like this: $this->artisan("my-command", ["--some-option" => "some-value"]) ->expectsOu...
Nummulite asked 3/6, 2021 at 21:41

4

Solved

I am testing a controller method and I am accessing a route in a test. Then I would like to make sure that the correct model was returned in the view and was loaded with all of the correct relatio...
Orissa asked 13/3, 2017 at 20:19

1

I have the following test: public function testStoreMemberValidation() { $response = $this->withExceptionHandling()->post('/api/members', [ "name" => "Eve", "age" => "invalid" ], [...
Cards asked 2/11, 2018 at 16:35

1

Solved

This is the response: [ { "data":{ "locales":{ "translate":[ { "created_at":"2018-05-28 12:49:53", "deleted_at":null, "id":1, "key":"nl_NL", "name":"Netherlands (Nederlands)", "...
Tarantass asked 29/5, 2018 at 8:25

3

Solved

I'm upgrading an old Laravel personal project from 5.2 to 5.4. The upgrade to 5.3 seems to have gone OK, but now I'm moving to 5.4 I've run into an issue. The project used the old testing layer so...
Hideaway asked 25/6, 2017 at 10:29

1

Solved

According to the Laravel Documentation, I can use Queue::fake(); prevent jobs from being queued. What is not clear how to test (PHPUnit) a few methods in the Job Class while it is not being queued...
Mortification asked 30/9, 2017 at 13:54
1

© 2022 - 2025 — McMap. All rights reserved.