mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 18:00:17 +02:00
Fix support for associative tag arrays, refs #588
This commit is contained in:
@@ -27,7 +27,7 @@ class TagProcessor
|
||||
|
||||
public function addTags(array $tags = array())
|
||||
{
|
||||
$this->tags = array_values(array_unique(array_merge($this->tags, $tags)));
|
||||
$this->tags = array_merge($this->tags, $tags);
|
||||
}
|
||||
|
||||
public function setTags(array $tags = array())
|
||||
|
@@ -42,8 +42,8 @@ class TagProcessorTest extends TestCase
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertEquals(array('a', 'b'), $record['extra']['tags']);
|
||||
|
||||
$processor->addTags(array('a', 'c'));
|
||||
$processor->addTags(array('a', 'c', 'foo' => 'bar'));
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertEquals(array('a', 'b', 'c'), $record['extra']['tags']);
|
||||
$this->assertEquals(array('a', 'b', 'a', 'c', 'foo' => 'bar'), $record['extra']['tags']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user