���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/123vid/vendor/monolog/monolog/tests/Monolog/Handler/ |
<?php /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Monolog\TestCase; use Monolog\Logger; use Monolog\Formatter\LineFormatter; use Monolog\Processor\WebProcessor; class AbstractHandlerTest extends TestCase { /** * @covers Monolog\Handler\AbstractHandler::__construct * @covers Monolog\Handler\AbstractHandler::getLevel * @covers Monolog\Handler\AbstractHandler::setLevel * @covers Monolog\Handler\AbstractHandler::getBubble * @covers Monolog\Handler\AbstractHandler::setBubble * @covers Monolog\Handler\AbstractHandler::getFormatter * @covers Monolog\Handler\AbstractHandler::setFormatter */ public function testConstructAndGetSet() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); $this->assertEquals(Logger::WARNING, $handler->getLevel()); $this->assertEquals(false, $handler->getBubble()); $handler->setLevel(Logger::ERROR); $handler->setBubble(true); $handler->setFormatter($formatter = new LineFormatter); $this->assertEquals(Logger::ERROR, $handler->getLevel()); $this->assertEquals(true, $handler->getBubble()); $this->assertSame($formatter, $handler->getFormatter()); } /** * @covers Monolog\Handler\AbstractHandler::handleBatch */ public function testHandleBatch() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); $handler->expects($this->exactly(2)) ->method('handle'); $handler->handleBatch(array($this->getRecord(), $this->getRecord())); } /** * @covers Monolog\Handler\AbstractHandler::isHandling */ public function testIsHandling() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); $this->assertTrue($handler->isHandling($this->getRecord())); $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); } /** * @covers Monolog\Handler\AbstractHandler::__construct */ public function testHandlesPsrStyleLevels() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array('warning', false)); $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); $handler->setLevel('debug'); $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG))); } /** * @covers Monolog\Handler\AbstractHandler::getFormatter * @covers Monolog\Handler\AbstractHandler::getDefaultFormatter */ public function testGetFormatterInitializesDefault() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); $this->assertInstanceOf('Monolog\Formatter\LineFormatter', $handler->getFormatter()); } /** * @covers Monolog\Handler\AbstractHandler::pushProcessor * @covers Monolog\Handler\AbstractHandler::popProcessor * @expectedException LogicException */ public function testPushPopProcessor() { $logger = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); $processor1 = new WebProcessor; $processor2 = new WebProcessor; $logger->pushProcessor($processor1); $logger->pushProcessor($processor2); $this->assertEquals($processor2, $logger->popProcessor()); $this->assertEquals($processor1, $logger->popProcessor()); $logger->popProcessor(); } /** * @covers Monolog\Handler\AbstractHandler::pushProcessor * @expectedException InvalidArgumentException */ public function testPushProcessorWithNonCallable() { $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); $handler->pushProcessor(new \stdClass()); } }