diff --git a/core/tests/UtilTest.php b/core/tests/UtilTest.php index deaeca5c..d622cc2d 100644 --- a/core/tests/UtilTest.php +++ b/core/tests/UtilTest.php @@ -162,35 +162,4 @@ class UtilTest extends TestCase path_to_tags("/category:/tag/baz.jpg") ); } - - public function test_get_query(): void - { - // niceurls - $_SERVER["REQUEST_URI"] = "/test/tasty/cake"; - $this->assertEquals("/tasty/cake", _get_query()); - - // no niceurls - $_SERVER["REQUEST_URI"] = "/test/index.php?q=/tasty/cake"; - $this->assertEquals("/tasty/cake", _get_query()); - - // leave url encoding alone - $_SERVER["REQUEST_URI"] = "/test/index.php?q=/tasty/cake%20pie"; - $this->assertEquals("/tasty/cake%20pie", _get_query()); - - // if just viewing index.php - $_SERVER["REQUEST_URI"] = "/test/index.php"; - $this->assertEquals("/", _get_query()); - - // niceurl root - $_SERVER["REQUEST_URI"] = "/test/"; - $this->assertEquals("/", _get_query()); - - // niceurls with encoded slashes - $_SERVER["REQUEST_URI"] = "/test/post/list/tasty%2Fcake/1"; - $this->assertEquals("/post/list/tasty%2Fcake/1", _get_query()); - - // query string with encoded slashes - $_SERVER["REQUEST_URI"] = "/test/index.php?q=/post/list/tasty%2Fcake/1"; - $this->assertEquals("/post/list/tasty%2Fcake/1", _get_query()); - } } diff --git a/ext/link_scan/test.php b/ext/link_scan/test.php index 075b560d..9fe8a785 100644 --- a/ext/link_scan/test.php +++ b/ext/link_scan/test.php @@ -19,7 +19,7 @@ class LinkScanTest extends ShimmiePHPUnitTestCase But there is no http://example.com/post/view/65432 "; - $page = $this->post_page("post/list", ["search" => $text]); + $page = $this->get_page("post/list", ["search" => $text]); $this->assertEquals(PageMode::REDIRECT, $page->mode); $this->assertEquals("/test/post/list/id%3D{$image_id_1}%2C{$image_id_2}/1", $page->redirect); @@ -35,7 +35,7 @@ class LinkScanTest extends ShimmiePHPUnitTestCase Look at http://example.com/_images/feb01bab5698a11dd87416724c7a89e3/foobar.jpg there is an image or search for e106ea2983e1b77f11e00c0c54e53805 but one that doesn't exist is e106ea2983e1b77f11e00c0c54e50000 o.o"; - $page = $this->post_page("post/list", ["search" => $text]); + $page = $this->get_page("post/list", ["search" => $text]); $this->assertEquals(PageMode::REDIRECT, $page->mode); $this->assertEquals("/test/post/list/id%3D{$image_id_1}%2C{$image_id_2}/1", $page->redirect); @@ -48,7 +48,7 @@ class LinkScanTest extends ShimmiePHPUnitTestCase $this->post_image("tests/favicon.png", "TeStCase"); $text = "Look at feb01bab5698a11dd87416724c7a89e3/foobar.jpg"; - $page = $this->post_page("post/list", ["search" => $text]); + $page = $this->get_page("post/list", ["search" => $text]); $this->assertEquals(PageMode::REDIRECT, $page->mode); $this->assertEquals("/test/post/list/at%20feb01bab5698a11dd87416724c7a89e3%2Ffoobar.jpg%20Look/1", $page->redirect);