1 | <?php |
||
17 | class ContainerTest extends \PHPUnit_Framework_TestCase { |
||
18 | |||
19 | public function testCanConstruct() { |
||
26 | |||
27 | public function testTryToConstructForInvalidIdThrowsException() { |
||
31 | |||
32 | public function testGetIdAndData() { |
||
33 | |||
34 | $expected = array( 'Bar' => new \stdClass ); |
||
35 | |||
36 | $instance = new Container( |
||
37 | 'Foo', |
||
38 | $expected |
||
39 | ); |
||
40 | |||
41 | $this->assertEquals( |
||
42 | 'Foo', |
||
43 | $instance->getId() |
||
44 | ); |
||
45 | |||
46 | $this->assertEquals( |
||
47 | $expected, |
||
48 | $instance->getData() |
||
49 | ); |
||
50 | |||
51 | $this->assertFalse( |
||
52 | $instance->isEmpty() |
||
53 | ); |
||
54 | } |
||
55 | |||
56 | public function testExpiry() { |
||
57 | |||
58 | $instance = new Container( |
||
59 | 'Foo', |
||
60 | array() |
||
61 | ); |
||
62 | |||
63 | $instance->setExpiryInSeconds( 42 ); |
||
64 | |||
65 | $this->assertSame( |
||
66 | 42, |
||
67 | $instance->getExpiry() |
||
68 | ); |
||
69 | } |
||
70 | |||
71 | public function testGetAndSet() { |
||
110 | |||
111 | public function testHasAndDelete() { |
||
130 | |||
131 | public function testAddToLinkedList() { |
||
145 | |||
146 | } |
||
147 |
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: