public function testSet() { $col = new Collection(); $col->set(4, 'bar'); $this->assertEquals(array(4 => 'bar'), $col->getData(), 'set() adds an element to the collection with a key'); $col = new Collection(); $col->set(null, 'foo'); $col->set(null, 'bar'); $this->assertEquals(array('foo', 'bar'), $col->getData(), 'set() adds an element to the collection without a key'); }