1 | <?php |
||
18 | class CompoundTest extends \PHPUnit_Framework_TestCase |
||
19 | { |
||
20 | /** |
||
21 | * @covers ::__construct |
||
22 | * |
||
23 | * @expectedException \InvalidArgumentException |
||
24 | * @expectedExceptionMessage A compound type can only have other types as elements |
||
25 | */ |
||
26 | public function testCompoundCannotBeConstructedFromType() |
||
30 | |||
31 | /** |
||
32 | * @covers ::get |
||
33 | * |
||
34 | * @uses \phpDocumentor\Reflection\Types\Compound::__construct |
||
35 | * @uses \phpDocumentor\Reflection\Types\Compound::has |
||
36 | * @uses \phpDocumentor\Reflection\Types\Integer |
||
37 | */ |
||
38 | public function testCompoundGetType() |
||
44 | |||
45 | /** |
||
46 | * @covers ::get |
||
47 | * |
||
48 | * @uses \phpDocumentor\Reflection\Types\Compound::__construct |
||
49 | * @uses \phpDocumentor\Reflection\Types\Compound::has |
||
50 | */ |
||
51 | public function testCompoundGetNotExistingType() |
||
55 | |||
56 | /** |
||
57 | * @covers ::has |
||
58 | * |
||
59 | * @uses \phpDocumentor\Reflection\Types\Compound::__construct |
||
60 | * @uses \phpDocumentor\Reflection\Types\Integer |
||
61 | */ |
||
62 | public function testCompoundHasType() |
||
66 | |||
67 | /** |
||
68 | * @covers ::has |
||
69 | * |
||
70 | * @uses \phpDocumentor\Reflection\Types\Compound::__construct |
||
71 | */ |
||
72 | public function testCompoundHasNotExistingType() |
||
76 | |||
77 | /** |
||
78 | * @covers ::__construct |
||
79 | * @covers ::__toString |
||
80 | * |
||
81 | * @uses \phpDocumentor\Reflection\Types\Integer |
||
82 | * @uses \phpDocumentor\Reflection\Types\Boolean |
||
83 | */ |
||
84 | public function testCompoundCanBeConstructedAndStringifiedCorrectly() |
||
88 | |||
89 | /** |
||
90 | * @covers ::getIterator |
||
91 | * |
||
92 | * @uses \phpDocumentor\Reflection\Types\Compound::__construct |
||
93 | * @uses \phpDocumentor\Reflection\Types\Integer |
||
94 | * @uses \phpDocumentor\Reflection\Types\Boolean |
||
95 | */ |
||
96 | public function testCompoundCanBeIterated() |
||
104 | } |
||
105 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: