1 | <?php |
||
19 | final class OptionsMiddlewareTest extends TestCase implements RequestMethodInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | const ALLOW_HEADERS = ['Authorization, Content-Type']; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | const ALLOW_ORIGIN = '*'; |
||
30 | |||
31 | /** |
||
32 | * @var OptionsMiddleware |
||
33 | */ |
||
34 | private $middleware; |
||
35 | |||
36 | /** |
||
37 | * @var callable |
||
38 | */ |
||
39 | private $next; |
||
40 | |||
41 | public function setUp() |
||
48 | |||
49 | /** |
||
50 | * @test |
||
51 | * @covers ::__invoke |
||
52 | */ |
||
53 | public function invokeMethodNotOptions() |
||
59 | |||
60 | /** |
||
61 | * @test |
||
62 | * @covers ::__invoke |
||
63 | * @expectedException \Slim\Exception\NotFoundException |
||
64 | */ |
||
65 | public function invokeMethodIsOptionsButNoRoute() |
||
70 | |||
71 | /** |
||
72 | * @test |
||
73 | * @covers ::__invoke |
||
74 | */ |
||
75 | public function invoke() |
||
96 | |||
97 | private function getRequest(string $method = self::METHOD_OPTIONS, Route $route = null) : Request |
||
106 | } |
||
107 |