| Total Complexity | 5 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class OptionsRequestBehaviorTest extends AbstractTestCase |
||
| 15 | { |
||
| 16 | /** @var OptionsRequestBehavior */ |
||
| 17 | protected $behavior; |
||
| 18 | |||
| 19 | public function setUp() |
||
| 20 | { |
||
| 21 | parent::setUp(); |
||
| 22 | $this->behavior = new OptionsRequestBehavior([ |
||
| 23 | 'request' => new class extends web\Request |
||
| 24 | { |
||
| 25 | public function setMethod(string $method): void |
||
| 29 | }, |
||
| 30 | 'response' => new class extends web\Response |
||
|
|
|||
| 31 | { |
||
| 32 | public $triggered = false; |
||
| 33 | |||
| 34 | public function send(): void |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @expectedException \yii\base\ExitException |
||
| 44 | */ |
||
| 45 | public function testExit(): void |
||
| 55 | |||
| 56 | public function testNotExit(): void |
||
| 62 | } |
||
| 63 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.