public function testHasGetLinkByName() { $obj = new Collection(); $obj->setLinks(array(new Link('http://www.google.com', 'alternate', 'google'), new Link('http://www.yahoo.com', 'alternate', 'yahoo'))); $this->assertTrue($obj->hasLinkByName('google')); $this->assertTrue($obj->hasLinkByName('yahoo')); $this->assertFalse($obj->hasLinkByName('bing')); $this->assertSame('http://www.google.com', $obj->getLinkByName('google')->getHref()); $this->assertSame('http://www.yahoo.com', $obj->getLinkByName('yahoo')->getHref()); $this->assertSame('', $obj->getLinkByName('bing')->getHref()); }