public function testAddCollection() { $testTwoElementArray = array($this->testEntities[2], $this->testEntities[3]); $coll2 = ConcreteCollection::fromArray($testTwoElementArray); $this->coll->addCollection($coll2); $this->assertSame($this->coll->count(), 3); $this->assertEquals($this->coll->getObjects()[0], $this->testEntities[1]); $this->assertEquals($this->coll->getObjects()[1], $this->testEntities[2]); $this->assertEquals($this->coll->getObjects()[2], $this->testEntities[3]); $this->coll->addCollection($coll2, 0); $this->assertSame($this->coll->count(), 5); $this->assertEquals($this->coll->getObjects()[0], $this->testEntities[2]); $this->assertEquals($this->coll->getObjects()[1], $this->testEntities[3]); $this->assertEquals($this->coll->getObjects()[2], $this->testEntities[1]); $this->assertEquals($this->coll->getObjects()[3], $this->testEntities[2]); $this->assertEquals($this->coll->getObjects()[4], $this->testEntities[3]); $oneElementArray = array($this->testEntities[5]); $coll3 = ConcreteCollection::fromArray($oneElementArray); $this->coll->addCollection($coll3, -1); $this->assertSame($this->coll->count(), 6); $this->assertEquals($this->coll->getObjects()[0], $this->testEntities[2]); $this->assertEquals($this->coll->getObjects()[1], $this->testEntities[3]); $this->assertEquals($this->coll->getObjects()[2], $this->testEntities[1]); $this->assertEquals($this->coll->getObjects()[3], $this->testEntities[2]); $this->assertEquals($this->coll->getObjects()[4], $this->testEntities[5]); $this->assertEquals($this->coll->getObjects()[5], $this->testEntities[3]); }