Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added assertions for test cases #16

Merged
merged 1 commit into from

2 participants

@JanMalte

This PR will add some assertions to the LoggerInterfaceTest

@Seldaek Seldaek referenced this pull request from a commit
@Seldaek Seldaek Fix new assertions, refs #16 5144da9
@Seldaek Seldaek merged commit f39f9d6 into php-fig:master
@Seldaek
Owner

Thanks, it wasn't completely right though, I tweaked the last test a bit (see above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2013
  1. @JanMalte
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 1 deletion.
  1. +13 −1 Psr/Log/Test/LoggerInterfaceTest.php
View
14 Psr/Log/Test/LoggerInterfaceTest.php
@@ -86,6 +86,9 @@ public function testObjectCastToString()
->will($this->returnValue('DUMMY'));
$this->getLogger()->warning($dummy);
+
+ $expected = array('warning DUMMY');
+ $this->assertEquals($expected, $this->getLogs());
}
public function testContextCanContainAnything()
@@ -102,15 +105,24 @@ public function testContextCanContainAnything()
);
$this->getLogger()->warning('Crazy context data', $context);
+
+ $expected = array('warning Crazy context data');
+ $this->assertEquals($expected, $this->getLogs());
}
public function testContextExceptionKeyCanBeExceptionOrOtherValues()
{
$this->getLogger()->warning('Random message', array('exception' => 'oops'));
$this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
+
+ $expected = array(
+ 'warning Random message',
+ 'Uncaught Exception!'
+ );
+ $this->assertEquals($expected, $this->getLogs());
}
}
class DummyTest
{
-}
+}
Something went wrong with that request. Please try again.