public function testConvertToArray() { $collection = new BasicCollection(); $collection->add('foo'); $collection->add('bar'); $collection->add('baz'); $collection->remove('bar'); // this call should not create a gap in the index sequence $actual = $collection->toArray(); $expected = [0 => 'foo', 1 => 'baz']; self::assertEquals($expected, $actual); }