From 5277094ed527a1c4477177d102fe4c53551953e0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 19 Sep 2016 18:02:08 +0200 Subject: [PATCH] Make compatible with latest phpunit --- Psr/Log/Test/LoggerInterfaceTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Psr/Log/Test/LoggerInterfaceTest.php b/Psr/Log/Test/LoggerInterfaceTest.php index 06f250d..f66a2b0 100644 --- a/Psr/Log/Test/LoggerInterfaceTest.php +++ b/Psr/Log/Test/LoggerInterfaceTest.php @@ -84,7 +84,11 @@ public function testContextReplacement() public function testObjectCastToString() { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + if (method_exists($this, 'createMock')) { + $dummy = $this->createMock('Psr\Log\Test\DummyTest', array('__toString')); + } else { + $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + } $dummy->expects($this->once()) ->method('__toString') ->will($this->returnValue('DUMMY')); @@ -130,4 +134,7 @@ public function testContextExceptionKeyCanBeExceptionOrOtherValues() class DummyTest { + public function __toString() + { + } }