From b02f6a1dae3e3fae4af4b24e65256cdf653b2515 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 20 Mar 2022 14:35:25 +0100 Subject: Add function is_local_url() to check if url is local. --- tests/unit/includes/NetworkTest.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/unit/includes/NetworkTest.php (limited to 'tests') diff --git a/tests/unit/includes/NetworkTest.php b/tests/unit/includes/NetworkTest.php new file mode 100644 index 000000000..0b9b42e00 --- /dev/null +++ b/tests/unit/includes/NetworkTest.php @@ -0,0 +1,33 @@ +assertEquals($expected, is_local_url($url)); + } + + public function localUrlTestProvider() : array { + return [ + [ '/some/path', true ], + [ 'https://mytest.org/some/path', true ], + [ 'https://other.site/some/path', false ], + ]; + } +} + -- cgit v1.2.3