PHP code example of peridot-php / leo-http-foundation

1. Go to this page and download the library: Download peridot-php/leo-http-foundation 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/ */

    

peridot-php / leo-http-foundation example snippets


$assertion = Leo::assertion();
$assertion->extend(new LeoHttpFoundation());

expect($response)->to->allow(['POST', 'GET']);
expect($response)->to->not->allow(['GET']);

expect($response)->to->have->status(200);
expect($response)->to->not->have->status(400);

expect($response)->json->to->have->property('name');
expect($response)->json->to->loosely->equal($expected);
expect($response)->json(true, 999, JSON_BIGINT_AS_STRING)->to->equal($expected);