1 | <?php |
||
22 | final class DebugResourceCommandTest extends \PHPUnit_Framework_TestCase |
||
23 | { |
||
24 | /** |
||
25 | * @var RegistryInterface |
||
26 | */ |
||
27 | private $registry; |
||
28 | |||
29 | /** |
||
30 | * @var CommandTester |
||
31 | */ |
||
32 | private $tester; |
||
33 | |||
34 | public function setUp() |
||
41 | |||
42 | /** |
||
43 | * @test |
||
44 | */ |
||
45 | public function it_lists_all_resources_if_no_argument_is_given() |
||
46 | { |
||
47 | $this->registry->getAll()->willReturn([$this->createMetadata('one'), $this->createMetadata('two')]); |
||
48 | $this->tester->execute([]); |
||
49 | $display = $this->tester->getDisplay(); |
||
50 | |||
51 | $this->assertEquals(<<<'EOT' |
||
52 | +------------+ |
||
53 | | Alias | |
||
54 | +------------+ |
||
55 | | sylius.one | |
||
56 | | sylius.two | |
||
57 | +------------+ |
||
58 | |||
59 | EOT |
||
60 | , $display); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @test |
||
65 | */ |
||
66 | public function it_displays_the_metadata_for_given_resource_alias() |
||
67 | { |
||
68 | $this->registry->get('metadata.one')->willReturn($this->createMetadata('one')); |
||
69 | $this->tester->execute([ |
||
70 | 'resource' => 'metadata.one', |
||
71 | ]); |
||
72 | |||
73 | $display = $this->tester->getDisplay(); |
||
74 | |||
75 | $this->assertEquals(<<<'EOT' |
||
76 | +------------------------------+-----------------+ |
||
77 | | name | one | |
||
78 | | application | sylius | |
||
79 | | driver | doctrine/foobar | |
||
80 | | classes.foo | bar | |
||
81 | | classes.bar | foo | |
||
82 | | whatever.something.elephants | camels | |
||
83 | +------------------------------+-----------------+ |
||
84 | |||
85 | EOT |
||
86 | , $display); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @param string $suffix |
||
91 | * |
||
92 | * @return Metadata |
||
93 | */ |
||
94 | private function createMetadata($suffix) |
||
111 | } |
||
112 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..