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

Public Member Functions

 testConstructorOnlyTakesHandler ()
 Monolog::__construct InvalidArgumentException More...
 
 testHandle ()
 Monolog::__construct Monolog::handle More...
 
 testHandleBatch ()
 Monolog::handleBatch More...
 
 testIsHandling ()
 Monolog::isHandling More...
 
 testHandleUsesProcessors ()
 Monolog::handle More...
 
 testHandleException ()
 Monolog::handle 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 17 of file WhatFailureGroupHandlerTest.php.

Member Function Documentation

◆ testConstructorOnlyTakesHandler()

Monolog\Handler\WhatFailureGroupHandlerTest::testConstructorOnlyTakesHandler ( )

Monolog::__construct InvalidArgumentException

Definition at line 23 of file WhatFailureGroupHandlerTest.php.

References array.

24  {
25  new WhatFailureGroupHandler(array(new TestHandler(), "foo"));
26  }
Create styles array
The data for the language used.

◆ testHandle()

Monolog\Handler\WhatFailureGroupHandlerTest::testHandle ( )

Monolog::__construct Monolog::handle

Definition at line 32 of file WhatFailureGroupHandlerTest.php.

References $test, array, Monolog\Logger\DEBUG, Monolog\TestCase\getRecord(), and Monolog\Logger\INFO.

33  {
34  $testHandlers = array(new TestHandler(), new TestHandler());
35  $handler = new WhatFailureGroupHandler($testHandlers);
36  $handler->handle($this->getRecord(Logger::DEBUG));
37  $handler->handle($this->getRecord(Logger::INFO));
38  foreach ($testHandlers as $test) {
39  $this->assertTrue($test->hasDebugRecords());
40  $this->assertTrue($test->hasInfoRecords());
41  $this->assertTrue(count($test->getRecords()) === 2);
42  }
43  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
Create styles array
The data for the language used.
$test
Definition: Utf8Test.php:84
const INFO
Interesting events.
Definition: Logger.php:39
+ Here is the call graph for this function:

◆ testHandleBatch()

Monolog\Handler\WhatFailureGroupHandlerTest::testHandleBatch ( )

Monolog::handleBatch

Definition at line 48 of file WhatFailureGroupHandlerTest.php.

References $test, array, Monolog\Logger\DEBUG, Monolog\TestCase\getRecord(), and Monolog\Logger\INFO.

49  {
50  $testHandlers = array(new TestHandler(), new TestHandler());
51  $handler = new WhatFailureGroupHandler($testHandlers);
52  $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
53  foreach ($testHandlers as $test) {
54  $this->assertTrue($test->hasDebugRecords());
55  $this->assertTrue($test->hasInfoRecords());
56  $this->assertTrue(count($test->getRecords()) === 2);
57  }
58  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
Create styles array
The data for the language used.
$test
Definition: Utf8Test.php:84
const INFO
Interesting events.
Definition: Logger.php:39
+ Here is the call graph for this function:

◆ testHandleException()

Monolog\Handler\WhatFailureGroupHandlerTest::testHandleException ( )

Monolog::handle

Definition at line 93 of file WhatFailureGroupHandlerTest.php.

References $records, $test, array, Monolog\TestCase\getRecord(), and Monolog\Logger\WARNING.

94  {
95  $test = new TestHandler();
96  $exception = new ExceptionTestHandler();
97  $handler = new WhatFailureGroupHandler(array($exception, $test, $exception));
98  $handler->pushProcessor(function ($record) {
99  $record['extra']['foo'] = true;
100 
101  return $record;
102  });
103  $handler->handle($this->getRecord(Logger::WARNING));
104  $this->assertTrue($test->hasWarningRecords());
105  $records = $test->getRecords();
106  $this->assertTrue($records[0]['extra']['foo']);
107  }
$records
Definition: simple_test.php:22
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

◆ testHandleUsesProcessors()

Monolog\Handler\WhatFailureGroupHandlerTest::testHandleUsesProcessors ( )

Monolog::handle

Definition at line 75 of file WhatFailureGroupHandlerTest.php.

References $records, $test, array, Monolog\TestCase\getRecord(), and Monolog\Logger\WARNING.

76  {
77  $test = new TestHandler();
78  $handler = new WhatFailureGroupHandler(array($test));
79  $handler->pushProcessor(function ($record) {
80  $record['extra']['foo'] = true;
81 
82  return $record;
83  });
84  $handler->handle($this->getRecord(Logger::WARNING));
85  $this->assertTrue($test->hasWarningRecords());
86  $records = $test->getRecords();
87  $this->assertTrue($records[0]['extra']['foo']);
88  }
$records
Definition: simple_test.php:22
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

◆ testIsHandling()

Monolog\Handler\WhatFailureGroupHandlerTest::testIsHandling ( )

Monolog::isHandling

Definition at line 63 of file WhatFailureGroupHandlerTest.php.

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

64  {
65  $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING));
66  $handler = new WhatFailureGroupHandler($testHandlers);
67  $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR)));
68  $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING)));
69  $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG)));
70  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
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.

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