コード例 #1
0
ファイル: LinkManyTest.php プロジェクト: harp-orm/harp
 /**
  * @covers ::__construct
  * @covers ::get
  * @covers ::getRel
  * @covers ::getOriginal
  * @covers ::clear
  */
 public function testConstruct()
 {
     $rel = Country::getRepo()->getRel('cities');
     $models = [new City(), new City()];
     $link = new LinkMany(new Country(), $rel, $models);
     $this->assertSame($rel, $link->getRel());
     $this->assertSame($models, $link->get()->toArray());
     $this->assertSame($models, $link->getOriginal()->toArray());
     $link->clear();
     $this->assertCount(0, $link);
 }