コード例 #1
0
ファイル: HalTest.php プロジェクト: zfcampus/zf-hal
 public function testWillNotAllowInjectingASelfRelationMultipleTimes()
 {
     $entity = new Entity(['id' => 1, 'foo' => 'bar'], 1);
     $links = $entity->getLinks();
     $this->assertFalse($links->has('self'));
     $this->plugin->injectSelfLink($entity, 'hostname/resource');
     $this->assertTrue($links->has('self'));
     $link = $links->get('self');
     $this->assertInstanceof('ZF\\Hal\\Link\\Link', $link);
     $this->plugin->injectSelfLink($entity, 'hostname/resource');
     $this->assertTrue($links->has('self'));
     $link = $links->get('self');
     $this->assertInstanceof('ZF\\Hal\\Link\\Link', $link);
 }