1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
<?php
namespace Guzzle\Tests\Log;
use Guzzle\Log\PsrLogAdapter;
use Monolog\Logger;
use Monolog\Handler\TestHandler;
class PsrLogAdapterTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testLogsMessagesToAdaptedObject()
{
$log = new Logger('test');
$handler = new TestHandler();
$log->pushHandler($handler);
$adapter = new PsrLogAdapter($log);
$adapter->log('test!', LOG_INFO);
$this->assertTrue($handler->hasInfoRecords());
$this->assertSame($log, $adapter->getLogObject());
}
}