1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-11 23:54:04 +02:00

Replace boilerplate with magic methods

This commit is contained in:
Austin Hyde
2015-06-20 19:36:57 -04:00
parent 202d3750d6
commit 3e8f0ecb36
2 changed files with 64 additions and 122 deletions

View File

@@ -28,6 +28,9 @@ class TestHandlerTest extends TestCase
$record = $this->getRecord($level, 'test'.$method);
$this->assertFalse($handler->{'has'.$method}($record), 'has'.$method);
$this->assertFalse($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains');
$this->assertFalse($handler->{'has'.$method.'ThatPasses'}(function($rec){
return true;
}), 'has'.$method.'ThatPasses');
$this->assertFalse($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
$handler->handle($record);
@@ -35,6 +38,9 @@ class TestHandlerTest extends TestCase
$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.'ThatPasses'}(function($rec){
return true;
}), 'has'.$method.'ThatPasses');
$this->assertTrue($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
$records = $handler->getRecords();