summaryrefslogtreecommitdiffstats
path: root/tests/Monolog/Processor/WebProcessorTest.php
diff options
context:
space:
mode:
authorJordi Boggiano <j.boggiano@seld.be>2011-06-29 18:58:26 +0200
committerJordi Boggiano <j.boggiano@seld.be>2011-06-29 18:58:40 +0200
commit78a26a3f4f6e51b9bf6a7f328a945e3b8c1b408c (patch)
tree00f6008e10a0aaf6dd945a8faaf5ea0c0aa56566 /tests/Monolog/Processor/WebProcessorTest.php
parentc465a5dd02179c98ce1f58c4b002ff31b608eda9 (diff)
downloadmonolog-78a26a3f4f6e51b9bf6a7f328a945e3b8c1b408c.zip
monolog-78a26a3f4f6e51b9bf6a7f328a945e3b8c1b408c.tar.gz
monolog-78a26a3f4f6e51b9bf6a7f328a945e3b8c1b408c.tar.bz2
Tested WebProcessor
Diffstat (limited to 'tests/Monolog/Processor/WebProcessorTest.php')
-rw-r--r--tests/Monolog/Processor/WebProcessorTest.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/Monolog/Processor/WebProcessorTest.php b/tests/Monolog/Processor/WebProcessorTest.php
new file mode 100644
index 0000000..28a04c9
--- /dev/null
+++ b/tests/Monolog/Processor/WebProcessorTest.php
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * This file is part of the Monolog package.
+ *
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Processor;
+
+use Monolog\TestCase;
+
+class WebProcessorTest extends TestCase
+{
+ public function testProcessor()
+ {
+ $server = array(
+ 'REQUEST_URI' => 'A',
+ 'REMOTE_ADDR' => 'B',
+ 'REQUEST_METHOD' => 'C',
+ );
+ $processor = new WebProcessor($server);
+ $record = $processor($this->getRecord());
+ $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']);
+ $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']);
+ $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']);
+ }
+
+ /**
+ * @expectedException UnexpectedValueException
+ */
+ public function testInvalidData()
+ {
+ new WebProcessor(new \stdClass);
+ }
+}