コード例 #1
0
ファイル: LinkMapTest.php プロジェクト: harp-orm/core
 /**
  * @covers ::get
  * @covers ::has
  * @covers ::getRepo
  * @covers ::isEmpty
  * @covers ::__construct
  */
 public function testTest()
 {
     $map = new LinkMap(Model::getRepo());
     $model = new Model();
     $this->assertFalse($map->has($model));
     $this->assertSame(Model::getRepo(), $map->getRepo());
     $this->assertTrue($map->isEmpty($model));
     $links = $map->get($model);
     $this->assertInstanceOf('Harp\\Core\\Repo\\Links', $links);
     $this->assertEmpty($links->all());
     $this->assertTrue($map->has($model));
     $this->assertTrue($map->isEmpty($model));
     $links->add($this->getLinkOne());
     $this->assertTrue($map->has($model));
     $this->assertFalse($map->isEmpty($model));
     $links2 = $map->get($model);
     $this->assertSame($links, $links2);
 }