Skip to content

Laravel unit test assertion that tests for the absence of a JSON structure

Notifications You must be signed in to change notification settings

amsoell/assert-json-structure-missing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

TestResponse::assertJsonStructureMissing

The TestResponse::assertJsonStructureMissing assertion works just like TestResponse::assertJsonStructure, except that it tests for the absence of a particular structure.

$response = $this->get('/data');
$response->assertJsonStructureMissing([
    'data' => [
        'related' => [
            '*' => [
                'attribute',
            ],
        ],
    ],
]);

Full credit for this package goes to Behzad Shabani. This package just takes his pull request and packages it up so it's super easy to add to your Laravel application.

About

Laravel unit test assertion that tests for the absence of a JSON structure

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages