4 * This file is part of the Monolog package.
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Monolog\Processor;
16 class TagProcessorTest extends TestCase
19 * @covers Monolog\Processor\TagProcessor::__invoke
21 public function testProcessor()
23 $tags = array(1, 2, 3);
24 $processor = new TagProcessor($tags);
25 $record = $processor($this->getRecord());
27 $this->assertEquals($tags, $record['extra']['tags']);
31 * @covers Monolog\Processor\TagProcessor::__invoke
33 public function testProcessorTagModification()
35 $tags = array(1, 2, 3);
36 $processor = new TagProcessor($tags);
38 $record = $processor($this->getRecord());
39 $this->assertEquals($tags, $record['extra']['tags']);
41 $processor->setTags(array('a', 'b'));
42 $record = $processor($this->getRecord());
43 $this->assertEquals(array('a', 'b'), $record['extra']['tags']);
45 $processor->addTags(array('a', 'c', 'foo' => 'bar'));
46 $record = $processor($this->getRecord());
47 $this->assertEquals(array('a', 'b', 'a', 'c', 'foo' => 'bar'), $record['extra']['tags']);