| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 26 | { |
||
| 27 | $this->method = $method; |
||
| 28 | } |
||
| 29 | }, |
||
| 30 | 'response' => new class extends web\Response |
||
|
|
|||
| 31 | { |
||
| 32 | public $triggered = false; |
||
| 33 | |||
| 34 | public function send(): void |
||
| 35 | { |
||
| 36 | $this->triggered = true; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | ]); |
||
| 40 | } |
||
| 41 | |||
| 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.