public function testGetCount() { $collection = new OrderedMap(); $this->assertSame(0, $collection->count()); $collection->add('test'); $this->assertSame(1, $collection->count()); $collection->clear(); $this->assertSame(0, $collection->count()); $collection->addAll(range(0, 99999)); $this->assertSame(100000, $collection->count()); }
/** * Tests whether setAll() works as expected. * * @return void */ public function testSetAll() { $map = new OrderedMap(); $map->addAll(array('foo' => 'bar', 2 => 'baz', '1', 1.0)); $this->assertSame(array(0, 1, 2, 3), $map->getKeys()); $this->assertSame(array('bar', 'baz', '1', 1.0), $map->getValues()); }