/** * @covers ::getCurrentAndOriginal */ public function testGetCurrentAndOriginal() { $models = [new City(), new City()]; $link = new LinkMany(new Country(), Country::getRepo()->getRel('cities'), $models); $model1 = new City(); $model2 = new City(); $link->add($model1)->add($model2)->remove($models[0]); $result = $link->getCurrentAndOriginal(); $this->assertInstanceOf('Harp\\Harp\\Model\\Models', $result); $this->assertCount(4, $result); $this->assertTrue($result->has($model1)); $this->assertTrue($result->has($model2)); $this->assertTrue($result->has($models[0])); $this->assertTrue($result->has($models[1])); }