PHP code example of mathrix-education / openapi-assertions

1. Go to this page and download the library: Download mathrix-education/openapi-assertions 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/ */

    

mathrix-education / openapi-assertions example snippets


use \Mathrix\OpenAPI\Assertions\Lumen\LumenOpenAPIAssertions;

class TestCase extends LumenTestCase {
    use LumenOpenAPIAssertions;
    
    public static function setupBeforeClass()
    {
        self::$openAPISpecificationPath = PATH_TO_SPEC_YAML;
        self::bootLumenOpenAPIAssertions();
    }
}

class TestBar extends TesCase {
    public function testFoo() {
        // Your test code
        $this->assertOpenAPIResponse($response); // Where response extends \Illuminate\Http\Response
    }
}