public function testFindNoLinksInHTML() { $html = '<div><p>Hello World</p></div>'; $mf2 = Mf2\parse($html, 'http://source.example.net/'); $links = IndieWeb\MentionClientTest::findOutgoingLinks($mf2); $this->assertEquals(array(), $links); }
public function testDiscoverPingbackEndpoint() { $headers = "HTTP/1.1 200 OK\r\nX-Pingback: http://pingback.me/webmention?forward=http%3A%2F%2Faaronparecki.com%2Fwebmention.php\r\nLink: <http://aaronparecki.com/>; rel=\"me\"\r\n"; $target = 'http://example.com/'; $this->client->c('headers', $target, IndieWeb\MentionClientTest::_parse_headers($headers)); $endpoint = $this->client->discoverPingbackEndpoint($target); $this->assertEquals('http://pingback.me/webmention?forward=http%3A%2F%2Faaronparecki.com%2Fwebmention.php', $endpoint); }
public function testFindWebmentionLinkHeaderWithMultipleLinks() { $headers = "HTTP/1.1 200 OK\r\nLink: <http://pubsubhubbub.appspot.com>; rel=\"hub\", <http://pubsubhubbub.superfeedr.com>; rel=\"hub\", <http://notizblog.org/>; rel=\"self\", <http://pubsubhubbub.superfeedr.com>; rel=\"hub\", <http://notizblog.org/>; rel=\"self\", <http://notizblog.org/?webmention=endpoint>; rel=\"http://webmention.org/\", <http://notizblog.org/>; rel=shortlink\r\n "; $target = 'http://aaronparecki.com/'; $this->client->c('headers', $target, IndieWeb\MentionClientTest::_parse_headers($headers)); $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://notizblog.org/?webmention=endpoint', $endpoint); }