Test'; $webLink = new WebLink($this->container); $webLink->setUrl($url); $this->assertEquals($url, $webLink->getUrl()); $this->container['httpClient'] ->expects($this->once()) ->method('get') ->with($url) ->will($this->returnValue($html)); $this->assertEquals($title, $webLink->getTitle()); } public function testGetTitleFromUrl() { $url = 'https://kanboard.net/something'; $html = 'Test'; $webLink = new WebLink($this->container); $webLink->setUrl($url); $this->assertEquals($url, $webLink->getUrl()); $this->container['httpClient'] ->expects($this->once()) ->method('get') ->with($url) ->will($this->returnValue($html)); $this->assertEquals('kanboard.net/something', $webLink->getTitle()); } }