How can i test with PEST (and Laravel) that Model::shouldBeStrict is called inside the AppServiceProvider

37 Views Asked by At

I want to test, that Model::shouldBeStrict is called inside the AppServiceProvider.

I tried:

it('will use Model::shouldBeStrict', function () {
    $user = User::factory()->create();
    $a = $user->notExistingAttribute;
})->throws(Exception::class);

but no exception is thrown.

What can I do to test it?

0

There are 0 best solutions below