From d62756dcd5f65374800cf7196116ee7de0322dcc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 6 Mar 2017 16:02:50 +0900 Subject: [PATCH] Fix unit tests to ignore user warnings during CSRF test --- tests/unit/framework/SecurityTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/framework/SecurityTest.php b/tests/unit/framework/SecurityTest.php index c6e0aea16..ca36d35a8 100644 --- a/tests/unit/framework/SecurityTest.php +++ b/tests/unit/framework/SecurityTest.php @@ -106,6 +106,8 @@ class SecurityTest extends \Codeception\TestCase\Test public function testCheckCSRF() { + $error_reporting = error_reporting(0); + $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['HTTP_REFERER'] = ''; $this->assertTrue(Rhymix\Framework\Security::checkCSRF()); @@ -117,6 +119,8 @@ class SecurityTest extends \Codeception\TestCase\Test $this->assertFalse(Rhymix\Framework\Security::checkCSRF()); $this->assertTrue(Rhymix\Framework\Security::checkCSRF('http://www.rhymix.org/')); + + error_reporting($error_reporting); } public function testCheckXEE()