1 | <?php |
||
28 | class CopyTest extends \PHPUnit_Framework_TestCase |
||
29 | { |
||
30 | /** |
||
31 | * @var CopyTraitStub |
||
32 | */ |
||
33 | protected $fixture; |
||
34 | |||
35 | public function setUp() |
||
39 | |||
40 | /** |
||
41 | * @covers Axstrad\Component\Content\Traits\Copy::getCopy |
||
42 | */ |
||
43 | public function testGetCopyMethod1() |
||
49 | |||
50 | /** |
||
51 | * @covers Axstrad\Component\Content\Traits\Copy::setCopy |
||
52 | */ |
||
53 | public function testCanSetCopy() |
||
62 | |||
63 | /** |
||
64 | * @covers Axstrad\Component\Content\Traits\Copy::getCopy |
||
65 | * @depends testCanSetCopy |
||
66 | * @uses Axstrad\Component\Content\Traits\Copy::setCopy |
||
67 | */ |
||
68 | public function testGetCopyMethod2() |
||
76 | |||
77 | /** |
||
78 | * @covers Axstrad\Component\Content\Traits\Copy::setCopy |
||
79 | */ |
||
80 | public function testSetCopyReturnsSelf() |
||
87 | |||
88 | /** |
||
89 | * @covers Axstrad\Component\Content\Traits\Copy::setCopy |
||
90 | * @depends testCanSetCopy |
||
91 | */ |
||
92 | public function testCopyIsTypeCastToString() |
||
101 | |||
102 | /** |
||
103 | * @covers Axstrad\Component\Content\Traits\Copy::setCopy |
||
104 | * @depends testCanSetCopy |
||
105 | */ |
||
106 | public function testCopyCanBeSetToNull() |
||
116 | |||
117 | /** |
||
118 | * @expectedException InvalidArgumentException |
||
119 | * @covers Axstrad\Component\Content\Traits\Copy::setCopy |
||
120 | */ |
||
121 | public function testSetCopyThrowsExceptionIfArgumentIsNotScalar() |
||
125 | } |
||
126 |
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: