mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-23 14:32:44 +01:00
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
|
<?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);
|
||
|
}
|
||
|
}
|