PHP code example of jasonmccreary / laravel-test-assertions

1. Go to this page and download the library: Download jasonmccreary/laravel-test-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/ */

    

jasonmccreary / laravel-test-assertions example snippets



namespace Tests;

use JMac\Testing\Traits\AdditionalAssertions;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication, AdditionalAssertions;
}

assertActionUsesFormRequest(string $controller, string $method, string $form_request)

assertRouteUsesFormRequest(string $routeName, string $formRequest)

assertActionUsesMiddleware(string $controller, string $method, string|array $middleware)

assertRouteUsesMiddleware(string $routeName, array $middlewares, bool $exact)

assertValidationRules(array $expected, array $actual)

assertExactValidationRules(array $expected, array $actual)

assertValidationRuleContains($rule, string $class)

LaravelMatchers::isModel(Model $model = null)

LaravelMatchers::isCollection(Collection $collection = null)

LaravelMatchers::isEloquentCollection(Collection $collection = null)

createFormRequest(string $class, array $data = [])