From 1d1f56be9d07a4d79af5c23e5c9b0e08147ee0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Wed, 11 Jan 2017 09:42:48 +0100 Subject: [PATCH 1/3] Avoid warnings due to deprecation of getMock() in PHPUnit. --- tests/TestCase.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 00e13445..fb800ebe 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -36,6 +36,16 @@ protected function expectCallableNever() protected function createCallableMock() { - return $this->getMock('React\Tests\EventLoop\CallableStub'); + $stub = 'React\Tests\EventLoop\CallableStub'; + + if (method_exists($this, 'createMock')) { + return $this->createMock($stub); + } + + if (method_exists($this, 'getMockBuilder')) { + return $this->getMockBuilder($stub)->getMock(); + } + + return $this->getMock($stub); } } From 41f472311920d69178cffb24ec8b6801a3a2bfea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Wed, 11 Jan 2017 09:51:33 +0100 Subject: [PATCH 2/3] Mock builder is not needed due to createMock(). --- tests/TestCase.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index fb800ebe..8aaefd1c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -42,10 +42,6 @@ protected function createCallableMock() return $this->createMock($stub); } - if (method_exists($this, 'getMockBuilder')) { - return $this->getMockBuilder($stub)->getMock(); - } - return $this->getMock($stub); } } From 680f2676912847ff3987b55b0639168637208707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Wed, 11 Jan 2017 10:22:51 +0100 Subject: [PATCH 3/3] Switch to mock builder as it works across all PHPUnit versions. --- tests/TestCase.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 8aaefd1c..5114f4e0 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -36,12 +36,6 @@ protected function expectCallableNever() protected function createCallableMock() { - $stub = 'React\Tests\EventLoop\CallableStub'; - - if (method_exists($this, 'createMock')) { - return $this->createMock($stub); - } - - return $this->getMock($stub); + return $this->getMockBuilder('React\Tests\EventLoop\CallableStub')->getMock(); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy