Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function testHandleWorkProperly() |
||
13 | { |
||
14 | $manager = new Manager(); |
||
15 | |||
16 | $response = new Response($manager); |
||
17 | |||
18 | $middleware = new ParseInclude($response); |
||
19 | |||
20 | $request = Request::create('foo', 'GET', ['include' => 'foo,bar']); |
||
21 | |||
22 | $result = $middleware->handle($request, function () { |
||
23 | return 'callback working !'; |
||
24 | }); |
||
25 | |||
26 | $includes = $response->getManager()->getRequestedIncludes(); |
||
27 | |||
28 | $this->assertSame($manager, $response->getManager()); |
||
29 | $this->assertSame([ |
||
30 | 'foo', |
||
31 | 'bar' |
||
32 | ], $includes); |
||
33 | $this->assertSame('callback working !', $result); |
||
34 | } |
||
35 | } |
||
36 |