Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function testCollection() |
||
15 | { |
||
16 | $collection = new ValuesCollection(array('test')); |
||
17 | $collection->add('another', 1); |
||
18 | $collection->offsetSet('offset', 10); |
||
19 | $collection->offsetSet('missing', 5); |
||
20 | $collection->offsetUnset('missing'); |
||
21 | |||
22 | $expected = array('test', 'another' => 1, 'offset' => 10); |
||
23 | |||
24 | $iterator = new \ArrayIterator($expected); |
||
25 | |||
26 | $this->assertEquals($expected, $collection->getValues()); |
||
27 | $this->assertEquals($iterator, $collection->getIterator()); |
||
28 | $this->assertEquals(3, $collection->count()); |
||
29 | $this->assertTrue($collection->offsetExists('another')); |
||
30 | $this->assertFalse($collection->offsetExists('not_exist')); |
||
31 | $this->assertEquals('test', $collection->offsetGet(0)); |
||
32 | } |
||
33 | } |