Total Lines | 33 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function testGlob() |
||
12 | { |
||
13 | $controller = new TestController(); |
||
14 | |||
15 | $container = new class([ TestController::class => $controller ]) implements ContainerInterface { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $controllers; |
||
20 | |||
21 | public function __construct(array $controllers) |
||
22 | { |
||
23 | $this->controllers = $controllers; |
||
24 | } |
||
25 | |||
26 | public function get($id) |
||
27 | { |
||
28 | return $this->controllers[$id]; |
||
29 | } |
||
30 | |||
31 | public function has($id) |
||
32 | { |
||
33 | return isset($this->controllers[$id]); |
||
34 | } |
||
35 | }; |
||
36 | |||
37 | $globControllerQueryProvider = new GlobControllerQueryProvider('TheCodingMachine\\GraphQL\\Controllers', $this->getRegistry(), $container, new NullCache()); |
||
38 | |||
39 | $queries = $globControllerQueryProvider->getQueries(); |
||
40 | $this->assertCount(5, $queries); |
||
41 | |||
42 | $mutations = $globControllerQueryProvider->getMutations(); |
||
43 | $this->assertCount(1, $mutations); |
||
44 | |||
47 |