ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
Monolog\Handler\AbstractHandlerTest Class Reference
+ Inheritance diagram for Monolog\Handler\AbstractHandlerTest:
+ Collaboration diagram for Monolog\Handler\AbstractHandlerTest:

Public Member Functions

 testConstructAndGetSet ()
 Monolog::__construct Monolog::getLevel Monolog::setLevel Monolog::getBubble Monolog::setBubble Monolog::getFormatter Monolog::setFormatter More...
 
 testHandleBatch ()
 Monolog::handleBatch More...
 
 testIsHandling ()
 Monolog::isHandling More...
 
 testHandlesPsrStyleLevels ()
 Monolog::__construct More...
 
 testGetFormatterInitializesDefault ()
 Monolog::getFormatter Monolog::getDefaultFormatter More...
 
 testPushPopProcessor ()
 Monolog::pushProcessor Monolog::popProcessor LogicException More...
 
 testPushProcessorWithNonCallable ()
 Monolog::pushProcessor InvalidArgumentException More...
 

Additional Inherited Members

- Protected Member Functions inherited from Monolog\TestCase
 getRecord ($level=Logger::WARNING, $message='test', $context=array())
 
 getMultipleRecords ()
 
 getIdentityFormatter ()
 

Detailed Description

Definition at line 19 of file AbstractHandlerTest.php.

Member Function Documentation

◆ testConstructAndGetSet()

Monolog\Handler\AbstractHandlerTest::testConstructAndGetSet ( )

Monolog::__construct Monolog::getLevel Monolog::setLevel Monolog::getBubble Monolog::setBubble Monolog::getFormatter Monolog::setFormatter

Definition at line 30 of file AbstractHandlerTest.php.

References array, Monolog\Logger\ERROR, and Monolog\Logger\WARNING.

31  {
32  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false));
33  $this->assertEquals(Logger::WARNING, $handler->getLevel());
34  $this->assertEquals(false, $handler->getBubble());
35 
36  $handler->setLevel(Logger::ERROR);
37  $handler->setBubble(true);
38  $handler->setFormatter($formatter = new LineFormatter);
39  $this->assertEquals(Logger::ERROR, $handler->getLevel());
40  $this->assertEquals(true, $handler->getBubble());
41  $this->assertSame($formatter, $handler->getFormatter());
42  }
const ERROR
Runtime errors.
Definition: Logger.php:57
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.

◆ testGetFormatterInitializesDefault()

Monolog\Handler\AbstractHandlerTest::testGetFormatterInitializesDefault ( )

Monolog::getFormatter Monolog::getDefaultFormatter

Definition at line 80 of file AbstractHandlerTest.php.

81  {
82  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
83  $this->assertInstanceOf('Monolog\Formatter\LineFormatter', $handler->getFormatter());
84  }

◆ testHandleBatch()

Monolog\Handler\AbstractHandlerTest::testHandleBatch ( )

Monolog::handleBatch

Definition at line 47 of file AbstractHandlerTest.php.

References array, and Monolog\TestCase\getRecord().

48  {
49  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
50  $handler->expects($this->exactly(2))
51  ->method('handle');
52  $handler->handleBatch(array($this->getRecord(), $this->getRecord()));
53  }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ testHandlesPsrStyleLevels()

Monolog\Handler\AbstractHandlerTest::testHandlesPsrStyleLevels ( )

Monolog::__construct

Definition at line 68 of file AbstractHandlerTest.php.

References array, and Monolog\Logger\DEBUG.

69  {
70  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array('warning', false));
71  $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
72  $handler->setLevel('debug');
73  $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG)));
74  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
Create styles array
The data for the language used.

◆ testIsHandling()

Monolog\Handler\AbstractHandlerTest::testIsHandling ( )

Monolog::isHandling

Definition at line 58 of file AbstractHandlerTest.php.

References array, Monolog\Logger\DEBUG, and Monolog\Logger\WARNING.

59  {
60  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false));
61  $this->assertTrue($handler->isHandling($this->getRecord()));
62  $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
63  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.

◆ testPushPopProcessor()

Monolog\Handler\AbstractHandlerTest::testPushPopProcessor ( )

Monolog::pushProcessor Monolog::popProcessor LogicException

Definition at line 91 of file AbstractHandlerTest.php.

92  {
93  $logger = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
94  $processor1 = new WebProcessor;
95  $processor2 = new WebProcessor;
96 
97  $logger->pushProcessor($processor1);
98  $logger->pushProcessor($processor2);
99 
100  $this->assertEquals($processor2, $logger->popProcessor());
101  $this->assertEquals($processor1, $logger->popProcessor());
102  $logger->popProcessor();
103  }

◆ testPushProcessorWithNonCallable()

Monolog\Handler\AbstractHandlerTest::testPushProcessorWithNonCallable ( )

Monolog::pushProcessor InvalidArgumentException

Definition at line 109 of file AbstractHandlerTest.php.

110  {
111  $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler');
112 
113  $handler->pushProcessor(new \stdClass());
114  }

The documentation for this class was generated from the following file: