From a045d125311d23ed838d06fa63fd7e452f293dd0 Mon Sep 17 00:00:00 2001 From: s-martin Date: Sun, 3 Nov 2024 11:43:40 +0100 Subject: [PATCH] Delete tests/htdocs/inc/SetWlanIpMailTest.php (#2448) Revert the test file which was accidentally added --- tests/htdocs/inc/SetWlanIpMailTest.php | 69 -------------------------- 1 file changed, 69 deletions(-) delete mode 100644 tests/htdocs/inc/SetWlanIpMailTest.php diff --git a/tests/htdocs/inc/SetWlanIpMailTest.php b/tests/htdocs/inc/SetWlanIpMailTest.php deleted file mode 100644 index 97c04b97c..000000000 --- a/tests/htdocs/inc/SetWlanIpMailTest.php +++ /dev/null @@ -1,69 +0,0 @@ -getFunctionMock(__NAMESPACE__, 'parse_ini_file'); - $parse_ini_file->expects($this->atLeastOnce())->willReturn( - array( - "DEBUG_WebApp" => "FALSE", - "DEBUG_WebApp_API" => "FALSE" - )); - $_SERVER['REQUEST_METHOD'] = ''; - require_once 'htdocs/inc.setWlanIpMail.php'; - } - - /** - * @runInSeparateProcess - */ - public function testValidateEmail() { - $filter_var = $this->getFunctionMock(__NAMESPACE__, 'filter_var'); - $filter_var->expects($this->atLeastOnce())->willReturnCallback( - function ($email, $filter) { - $this->assertEquals(FILTER_VALIDATE_EMAIL, $filter); - return filter_var($email, $filter); - } - ); - - $this->assertTrue(filter_var('test@example.com', FILTER_VALIDATE_EMAIL)); - $this->assertFalse(filter_var('invalid-email', FILTER_VALIDATE_EMAIL)); - } - - /** - * @runInSeparateProcess - */ - public function testSanitizeEmail() { - $htmlspecialchars = $this->getFunctionMock(__NAMESPACE__, 'htmlspecialchars'); - $htmlspecialchars->expects($this->atLeastOnce())->willReturnCallback( - function ($string, $flags, $encoding) { - $this->assertEquals(ENT_QUOTES, $flags); - $this->assertEquals('UTF-8', $encoding); - return htmlspecialchars($string, $flags, $encoding); - } - ); - - $this->assertEquals('test@example.com', htmlspecialchars('test@example.com', ENT_QUOTES, 'UTF-8')); - $this->assertEquals('test<script>@example.com', htmlspecialchars('test