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() + { + } }