From e24074b4b25b420789217611d749e90e1319871d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 13 Apr 2018 03:08:03 -0300 Subject: Replace func_get_args by ... operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- test/classes/Plugins/Auth/AuthenticationHttpTest.php | 3 +-- test/classes/PmaTestCase.php | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/classes/Plugins/Auth/AuthenticationHttpTest.php b/test/classes/Plugins/Auth/AuthenticationHttpTest.php index 4fc2338d51..ac72bd292e 100644 --- a/test/classes/Plugins/Auth/AuthenticationHttpTest.php +++ b/test/classes/Plugins/Auth/AuthenticationHttpTest.php @@ -55,7 +55,7 @@ class AuthenticationHttpTest extends PmaTestCase unset($this->object); } - public function doMockResponse($set_minimal, $body_id, $set_title) + public function doMockResponse($set_minimal, $body_id, $set_title, ...$headers) { // mock footer $mockFooter = $this->getMockBuilder('PhpMyAdmin\Footer') @@ -89,7 +89,6 @@ class AuthenticationHttpTest extends PmaTestCase ->with(); // set mocked headers and footers - $headers = array_slice(func_get_args(), 3); $mockResponse = $this->mockResponse($headers); $mockResponse->expects($this->exactly($set_title)) diff --git a/test/classes/PmaTestCase.php b/test/classes/PmaTestCase.php index b2e72b7a51..d00a500a1b 100644 --- a/test/classes/PmaTestCase.php +++ b/test/classes/PmaTestCase.php @@ -33,11 +33,11 @@ class PmaTestCase extends TestCase /** * Creates mock of Response object for header testing * - * @param mixed $param parameter for header method + * @param mixed ...$param parameter for header method * * @return void */ - public function mockResponse() + public function mockResponse(...$param) { $this->restoreInstance = Response::getInstance(); @@ -55,8 +55,6 @@ class PmaTestCase extends TestCase ->with() ->will($this->returnValue(false)); - $param = func_get_args(); - if (count($param) > 0) { if (is_array($param[0])) { if (is_array($param[0][0]) && count($param) == 1) { -- cgit v1.2.3