client = new IndieWeb\MentionClientTest(false, 'empty'); } public function testDiscoverWebmentionEndpoint() { $headers = "HTTP/1.1 200 OK\r\nLink: ; rel=\"webmention\"\r\nLink: ; rel=\"me\"\r\n"; $target = 'http://example.com/'; $this->client->c('headers', $target, IndieWeb\MentionClientTest::_parse_headers($headers)); $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://aaronparecki.com/webmention.php', $endpoint); } 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: ; 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 testDiscoverWebmentionEndpointInHeader() { $target = 'http://target.example.com/header.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention-endpoint.example/queued-response', $endpoint); } public function testDiscoverPingbackEndpointInHeader() { $target = 'http://target.example.com/header.html'; $endpoint = $this->client->discoverPingbackEndpoint($target); $this->assertEquals('http://pingback-endpoint.example/valid-response', $endpoint); } public function testDiscoverWebmentionEndpointInBodyLink() { $target = 'http://target.example.com/body-link.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/webmention', $endpoint); $target = 'http://target.example.com/body-link-org.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/webmention', $endpoint); $target = 'http://target.example.com/body-link-org2.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/webmention', $endpoint); } public function testDiscoverPingbackEndpointInBodyLink() { $target = 'http://target.example.com/body-link.html'; $endpoint = $this->client->discoverPingbackEndpoint($target); $this->assertEquals('http://webmention.example/pingback', $endpoint); } public function testDiscoverPingbackEndpointInBodyWithoutMf2() { $target = 'http://target.example.com/body-link.html'; $this->client->usemf2 = false; $endpoint = $this->client->discoverPingbackEndpoint($target); $this->assertEquals('http://webmention.example/pingback', $endpoint); } public function testDiscoverWebmentionEndpointInBodyA() { $target = 'http://target.example.com/body-a.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/webmention', $endpoint); } public function testDiscoverWebmentionEndpointInBodyAWithoutMf2() { $target = 'http://target.example.com/body-a.html'; $this->client->usemf2 = false; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/webmention', $endpoint); } public function testShouldNotDiscoverWebmentionEndpointInBodyComment() { $target = 'http://target.example.com/false-endpoint-in-comment.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/correct', $endpoint); } public function testDiscoverWebmentionEndpointInDocumentOrder1() { $target = 'http://target.example.com/document-order-1.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/link', $endpoint); } public function testDiscoverWebmentionEndpointInDocumentOrder2() { $target = 'http://target.example.com/document-order-2.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://webmention.example/a', $endpoint); } public function testDiscoverWebmentionEndpointIsEmptyString() { $target = 'http://target.example.com/empty-string.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://target.example.com/empty-string.html', $endpoint); } public function testDiscoverWebmentionEndpointIsPathRelative() { $target = 'http://target.example.com/relative/path-relative-endpoint.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://target.example.com/relative/relative', $endpoint); } public function testDiscoverEndpointAfterRedirected() { $target = 'http://target.example.com/redirect.html'; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals('http://target.example.com/relative/webmention', $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest1() { $target = "http://target.example.com/webmention-rocks-test-1.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("http://target.example.com/test/1/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest2() { $target = "http://target.example.com/webmention-rocks-test-2.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("https://webmention.rocks/test/2/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest3() { $target = "http://target.example.com/webmention-rocks-test-3.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("http://target.example.com/test/3/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest4() { $target = "http://target.example.com/webmention-rocks-test-4.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("https://webmention.rocks/test/4/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest5() { $target = "http://target.example.com/webmention-rocks-test-5.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("http://target.example.com/test/5/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest6() { $target = "http://target.example.com/webmention-rocks-test-6.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("https://webmention.rocks/test/6/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest7() { $target = "http://target.example.com/webmention-rocks-test-7.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("https://webmention.rocks/test/7/webmention", $endpoint); } public function testDiscoverWebmentionEndpointInWebmentionRocksTest8() { $target = "http://target.example.com/webmention-rocks-test-8.html"; $endpoint = $this->client->discoverWebmentionEndpoint($target); $this->assertEquals("https://webmention.rocks/test/8/webmention", $endpoint); } }__halt_compiler();----SIGNATURE:----xykjbGLbSb+s8pq8tZumc+go7Dgomg44L8yQJPv6O+EcODtgJ3zzmuLxKwJRvgJPimI9C1Uv1doTsY757l4FFdMxHdBp+fgvUxZbYNI3adT/2VMUQWUYf3D69U+FrIYlAv4IVDf0c05pYSt3OrEUFEIa2WhBXHq43waUz2ewcGHbapul7gM7B6OFpH2299hq7JSRPoxSIKtakxeAgsG3R3R7CzYQLTr0jvc90WFPtAFOVTda2mPPA5No2CyMCfDKOLY6/WyWE6Pzo81JjrOUhvtowTrYR8UvPR75K9cxO4h8e/j5f050zkB/yiYpVf7rk4EJi64F4objHkMdFapQp/OMI4NLnFy2GmA+SDy66gE5A1UxVjSfBa45EdlOEhF/DuK1yEI9QuKIRKEdXb9i36d11eY+Vw2lyojivtivc+KsrPWuRsecYGPFqXUBZATAd/B5kWXz43301RYnGNfsNeNlzZhWWE30VcCLyKkrIRYEAoNWJvqJYKf5zIucUVer1ni5jnC/xSgIHqVIxzzjzpvcCKvIdfg7YUnCtxWTWtHa/kpyOg8JlOr6TJJdcrYJ2Ah9ytUUhz5mYaL29Ef8brWOYj9p+kB6DcbR9qhj+6yu6f5tTjzhRIwz/3Jk7WfPwFJV3rFBxK7lUa/Vj2Y14Lg4w0s8/DKfa8shKA6jaxE=----ATTACHMENT:----MjQxMzc2NDI4NDQwMTE1NiA2MTMzNjMwNzE0NjMzMjk4IDk0Nzk3OTA3MDQzNTY1MTQ=