Conditions | 1 |
Total Lines | 43 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testAll() |
||
13 | { |
||
14 | $reader1 = new class implements ReaderInterface |
||
15 | { |
||
16 | /** |
||
17 | * @inheritdoc |
||
18 | */ |
||
19 | public function read(FormInterface $form): array |
||
20 | { |
||
21 | return []; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @inheritdoc |
||
26 | */ |
||
27 | public function getPriority(): int |
||
28 | { |
||
29 | return 10; |
||
30 | } |
||
31 | }; |
||
32 | |||
33 | $reader2 = new class implements ReaderInterface |
||
34 | { |
||
35 | /** |
||
36 | * @inheritdoc |
||
37 | */ |
||
38 | public function read(FormInterface $form): array |
||
39 | { |
||
40 | return []; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | public function getPriority(): int |
||
47 | { |
||
48 | return 0; |
||
49 | } |
||
50 | }; |
||
51 | |||
52 | $registry = new ReaderRegistry([$reader1, $reader2]); |
||
53 | |||
54 | $this->assertSame([$reader2, $reader1], $registry->all()); |
||
55 | } |
||
57 |