1
0
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:
Jordi Boggiano
2015-07-13 11:06:01 +01:00
parent dc5150cc60
commit 328d66f13f
2 changed files with 3 additions and 3 deletions

View File

@@ -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())

View File

@@ -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']);
}
}