You are here

public function LoggerInterfaceTest::testObjectCastToString in Lockr 7.3

File

vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php, line 85

Class

LoggerInterfaceTest
Provides a base test class for ensuring compliance with the LoggerInterface.

Namespace

Psr\Log\Test

Code

public function testObjectCastToString() {
  if (method_exists($this, 'createPartialMock')) {
    $dummy = $this
      ->createPartialMock('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'));
  $this
    ->getLogger()
    ->warning($dummy);
  $expected = array(
    'warning DUMMY',
  );
  $this
    ->assertEquals($expected, $this
    ->getLogs());
}