1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-30 18:00:17 +02:00

Fix issues highlighted by @stof on first code review

This commit is contained in:
Ando Roots
2014-08-28 22:58:52 +03:00
parent 7944eecbd8
commit c8d0830860
2 changed files with 22 additions and 22 deletions

View File

@@ -58,7 +58,22 @@ class FleepHookHandlerTest extends TestCase
*/
public function testConstructorSetsExpectedDefaults()
{
$this->assertEquals(self::TOKEN, $this->handler->getToken());
// Test that the $token is saved when calling the constructor
$token = self::TOKEN;
$handler = $this->mockHandler(array('execCurl'));
$handler->expects($this->once())
->method('execCurl')
->with(
$this->callback(
function ($curlOpts) use ($token) {
return substr($curlOpts[CURLOPT_URL], -strlen($token)) === $token;
}
)
);
$this->sendLog($handler);
// Test that default values are assigned to $level and $bubble
$this->assertEquals(Logger::DEBUG, $this->handler->getLevel());
$this->assertEquals(true, $this->handler->getBubble());
}
@@ -102,7 +117,7 @@ class FleepHookHandlerTest extends TestCase
$expectedFormatter = new LineFormatter(null, null, true, true);
$expected = $expectedFormatter->format($record);
$handlerFormatter = $this->handler->getDefaultFormatter();
$handlerFormatter = $this->handler->getFormatter();
$actual = $handlerFormatter->format($record);
$this->assertEquals($expected, $actual, 'Empty context and extra arrays should not be rendered');