Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Components/Error.php
- This file was copied to src/tests/Browser/Components/Dialog.php.
<?php | <?php | ||||
namespace Tests\Browser\Components; | namespace Tests\Browser\Components; | ||||
use Laravel\Dusk\Component as BaseComponent; | use Laravel\Dusk\Component as BaseComponent; | ||||
use PHPUnit\Framework\Assert as PHPUnit; | use PHPUnit\Framework\Assert as PHPUnit; | ||||
class Error extends BaseComponent | class Error extends BaseComponent | ||||
{ | { | ||||
protected $code; | protected $code; | ||||
protected $message; | protected $message; | ||||
protected $messages_map = [ | protected $messages_map = [ | ||||
404 => 'Not Found' | 400 => "Bad request", | ||||
401 => "Unauthorized", | |||||
403 => "Access denied", | |||||
404 => "Not Found", | |||||
405 => "Method not allowed", | |||||
500 => "Internal server error", | |||||
]; | ]; | ||||
public function __construct($code) | public function __construct($code) | ||||
{ | { | ||||
$this->code = $code; | $this->code = $code; | ||||
$this->message = $this->messages_map[$code]; | $this->message = $this->messages_map[$code]; | ||||
} | } | ||||
Show All 39 Lines |