1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-21 04:11:47 +02:00
This commit is contained in:
Jordi Boggiano
2012-06-14 15:46:17 +02:00
parent 1530322897
commit da33c84d07
46 changed files with 193 additions and 206 deletions

View File

@@ -11,8 +11,6 @@
namespace Monolog\Formatter;
use Monolog\Logger;
/**
* @covers Monolog\Formatter\LineFormatter
*/

View File

@@ -11,8 +11,6 @@
namespace Monolog\Formatter;
use Monolog\Logger;
/**
* @covers Monolog\Formatter\NormalizerFormatter
*/

View File

@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
spl_autoload_register(function($class)
{
spl_autoload_register(function($class) {
$file = __DIR__.'/../../../../src/'.strtr($class, '\\', '/').'.php';
if (file_exists($file)) {
require $file;
return true;
}
});

View File

@@ -95,4 +95,4 @@ class TestChromePHPHandler extends ChromePHPHandler
{
return $this->headers;
}
}
}

View File

@@ -91,4 +91,4 @@ class TestFirePHPHandler extends FirePHPHandler
{
return $this->headers;
}
}
}

View File

@@ -38,6 +38,7 @@ class GelfHandlerTest extends TestCase
protected function getHandler($messagePublisher)
{
$handler = new GelfHandler($messagePublisher);
return $handler;
}

View File

@@ -16,11 +16,11 @@ use Gelf\Message;
class MockMessagePublisher extends MessagePublisher
{
public function publish(Message $message) {
public function publish(Message $message)
{
$this->lastMessage = $message;
}
public $lastMessage = null;
}

View File

@@ -72,4 +72,4 @@ class MailHandlerTest extends TestCase
$handler->handle($record);
}
}
}

View File

@@ -48,7 +48,8 @@ class MongoDBHandlerTest extends TestCase
}
if (!class_exists('Mongo')) {
class Mongo {
class Mongo
{
public function selectCollection() {}
}
}

View File

@@ -30,4 +30,4 @@ class NullHandlerTest extends TestCase
$handler = new NullHandler(Logger::WARNING);
$this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG)));
}
}
}

View File

@@ -12,7 +12,6 @@
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
/**
* @covers Monolog\Handler\RotatingFileHandler

View File

@@ -120,12 +120,12 @@ class SocketHandlerTest extends TestCase
{
$this->setMockHandler(array('fwrite'));
$callback = function($arg)
{
$callback = function($arg) {
$map = array(
'Hello world' => 6,
'world' => false,
);
return $map[$arg];
};
@@ -143,12 +143,12 @@ class SocketHandlerTest extends TestCase
{
$this->setMockHandler(array('fwrite', 'streamGetMetadata'));
$callback = function($arg)
{
$callback = function($arg) {
$map = array(
'Hello world' => 6,
'world' => 5,
);
return $map[$arg];
};
@@ -159,7 +159,6 @@ class SocketHandlerTest extends TestCase
->method('streamGetMetadata')
->will($this->returnValue(array('timed_out' => true)));
$this->writeRecord('Hello world');
}
@@ -171,9 +170,9 @@ class SocketHandlerTest extends TestCase
$this->setMockHandler(array('fwrite', 'streamGetMetadata'));
$res = $this->res;
$callback = function($string) use ($res)
{
$callback = function($string) use ($res) {
fclose($res);
return strlen('Hello');
};
@@ -201,12 +200,12 @@ class SocketHandlerTest extends TestCase
{
$this->setMockHandler(array('fwrite'));
$callback = function($arg)
{
$callback = function($arg) {
$map = array(
'Hello world' => 6,
'world' => 5,
);
return $map[$arg];
};

View File

@@ -11,8 +11,6 @@
namespace Monolog\Handler;
use Monolog\Logger;
class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
{
/**

View File

@@ -127,6 +127,7 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
$logger->pushHandler($handler);
$logger->pushProcessor(function($record) {
$record['extra']['win'] = true;
return $record;
});
$logger->addError('test');

View File

@@ -21,6 +21,7 @@ class IntrospectionProcessorTest extends TestCase
$processor = new IntrospectionProcessor();
$handler = new TestHandler();
$handler->pushProcessor($processor);
return $handler;
}
@@ -31,7 +32,7 @@ class IntrospectionProcessorTest extends TestCase
$tester->test($handler, $this->getRecord());
list($record) = $handler->getRecords();
$this->assertEquals(__FILE__, $record['extra']['file']);
$this->assertEquals(57, $record['extra']['line']);
$this->assertEquals(58, $record['extra']['line']);
$this->assertEquals('Acme\Tester', $record['extra']['class']);
$this->assertEquals('test', $record['extra']['function']);
}
@@ -42,7 +43,7 @@ class IntrospectionProcessorTest extends TestCase
\Acme\tester($handler, $this->getRecord());
list($record) = $handler->getRecords();
$this->assertEquals(__FILE__, $record['extra']['file']);
$this->assertEquals(63, $record['extra']['line']);
$this->assertEquals(64, $record['extra']['line']);
$this->assertEquals(null, $record['extra']['class']);
$this->assertEquals('Acme\tester', $record['extra']['function']);
}
@@ -52,7 +53,7 @@ namespace Acme;
class Tester
{
function test($handler, $record)
public function test($handler, $record)
{
$handler->handle($record);
}
@@ -61,4 +62,4 @@ class Tester
function tester($handler, $record)
{
$handler->handle($record);
}
}