1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-12 16:14:08 +02:00

Add a message to assertions to know which ones fail

This commit is contained in:
Austin Hyde
2015-06-20 19:14:33 -04:00
parent 9232d07b10
commit 29da1d8e77

View File

@@ -26,16 +26,16 @@ class TestHandlerTest extends TestCase
{
$handler = new TestHandler;
$record = $this->getRecord($level, 'test'.$method);
$this->assertFalse($handler->{'has'.$method}($record));
$this->assertFalse($handler->{'has'.$method.'ThatContains'}('test'));
$this->assertFalse($handler->{'has'.$method.'Records'}());
$this->assertFalse($handler->{'has'.$method}($record), 'has'.$method);
$this->assertFalse($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains');
$this->assertFalse($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
$handler->handle($record);
$this->assertFalse($handler->{'has'.$method}('bar'));
$this->assertTrue($handler->{'has'.$method}($record));
$this->assertTrue($handler->{'has'.$method}('test'.$method));
$this->assertTrue($handler->{'has'.$method.'ThatContains'}('test'));
$this->assertTrue($handler->{'has'.$method.'Records'}());
$this->assertFalse($handler->{'has'.$method}('bar'), 'has'.$method);
$this->assertTrue($handler->{'has'.$method}($record), 'has'.$method);
$this->assertTrue($handler->{'has'.$method}('test'.$method), 'has'.$method);
$this->assertTrue($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains');
$this->assertTrue($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
$records = $handler->getRecords();
unset($records[0]['formatted']);