PHP code example of laravelfr / api-testing

1. Go to this page and download the library: Download laravelfr/api-testing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravelfr / api-testing example snippets


 $response->assertJsonStructureEquals([
     'foo',
     'baz' => ['*' => ['bar' => ['*'], 'foo']],
     'bars' => ['*' => ['bar', 'foo']],
     'foobar' => ['foobar_foo', 'foobar_bar'],
 ]);
 

 $response->seeJsonTypedStructure([
     'foo' => 'integer',
     'baz' => ['*' => ['bar' => 'array', 'foo' => 'string']],
     'bars' => ['*' => ['bar' => 'boolean', 'foo' => 'float']],
     'foobar' => ['foobar_foo' => 'string', 'foobar_bar' => 'int'],
 ]);
 

 $response->jsonResponse('foobar.foobar_bar')); // 212