mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-13 08:34:12 +02:00
Add TagProcessor::addTags and TagProcessor::setTags, fixes #588
This commit is contained in:
@@ -26,4 +26,24 @@ class TagProcessorTest extends TestCase
|
||||
|
||||
$this->assertEquals($tags, $record['extra']['tags']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Processor\TagProcessor::__invoke
|
||||
*/
|
||||
public function testProcessorTagModification()
|
||||
{
|
||||
$tags = array(1, 2, 3);
|
||||
$processor = new TagProcessor($tags);
|
||||
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertEquals($tags, $record['extra']['tags']);
|
||||
|
||||
$processor->setTags(array('a', 'b'));
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertEquals(array('a', 'b'), $record['extra']['tags']);
|
||||
|
||||
$processor->addTags(array('a', 'c'));
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertEquals(array('a', 'b', 'c'), $record['extra']['tags']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user