Conditions | 1 |
Total Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function testBuild() |
||
25 | { |
||
26 | $instanciator = new ConstructorLessInstanciator; |
||
27 | $object = new class('bar') { |
||
28 | public $foo; |
||
29 | |||
30 | public function __construct(string $foo) |
||
31 | { |
||
32 | $this->foo = $foo; |
||
33 | } |
||
34 | }; |
||
35 | |||
36 | $this->assertInstanceOf( |
||
37 | 'stdClass', |
||
38 | $instanciator->build( |
||
39 | 'stdClass', |
||
40 | Map::of('string', 'variable') |
||
41 | ) |
||
42 | ); |
||
43 | |||
44 | $builtObject = $instanciator->build( |
||
45 | get_class($object), |
||
46 | Map::of('string', 'variable') |
||
47 | ); |
||
48 | |||
49 | $this->assertInstanceOf(get_class($object), $builtObject); |
||
50 | $this->assertNull($builtObject->foo); |
||
51 | } |
||
72 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.