Laravel - HTTP Tests - Sharing Errors

Some views may depend on errors shared in the global error bag provided by Laravel. To hydrate the error bag with error messages, you may use the withViewErrors method:

    
    $view = $this->withViewErrors([
        'name' => ['Please provide a valid name.']
    ])->view('form');
    
    $view->assertSee('Please provide a valid name.');