ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Monolog\Handler\TestHandlerTest Class Reference

Monolog More...

+ Inheritance diagram for Monolog\Handler\TestHandlerTest:
+ Collaboration diagram for Monolog\Handler\TestHandlerTest:

Public Member Functions

 testHandler ($method, $level)
 methodProvider More...
 
 methodProvider ()
 

Additional Inherited Members

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

Detailed Description

Monolog

Definition at line 20 of file TestHandlerTest.php.

Member Function Documentation

◆ methodProvider()

Monolog\Handler\TestHandlerTest::methodProvider ( )

Definition at line 53 of file TestHandlerTest.php.

References array, and DEBUG.

54  {
55  return array(
56  array('Emergency', Logger::EMERGENCY),
57  array('Alert' , Logger::ALERT),
58  array('Critical' , Logger::CRITICAL),
59  array('Error' , Logger::ERROR),
60  array('Warning' , Logger::WARNING),
61  array('Info' , Logger::INFO),
62  array('Notice' , Logger::NOTICE),
63  array('Debug' , Logger::DEBUG),
64  );
65  }
const NOTICE
Uncommon events.
Definition: Logger.php:44
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
const EMERGENCY
Urgent alert.
Definition: Logger.php:77
Create styles array
The data for the language used.
const CRITICAL
Critical conditions.
Definition: Logger.php:64
const ALERT
Action must be taken immediately.
Definition: Logger.php:72
const INFO
Interesting events.
Definition: Logger.php:39

◆ testHandler()

Monolog\Handler\TestHandlerTest::testHandler (   $method,
  $level 
)

methodProvider

Definition at line 25 of file TestHandlerTest.php.

References Monolog\TestCase\getRecord().

26  {
27  $handler = new TestHandler;
28  $record = $this->getRecord($level, 'test'.$method);
29  $this->assertFalse($handler->{'has'.$method}($record), 'has'.$method);
30  $this->assertFalse($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains');
31  $this->assertFalse($handler->{'has'.$method.'ThatPasses'}(function ($rec) {
32  return true;
33  }), 'has'.$method.'ThatPasses');
34  $this->assertFalse($handler->{'has'.$method.'ThatMatches'}('/test\w+/'));
35  $this->assertFalse($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
36  $handler->handle($record);
37 
38  $this->assertFalse($handler->{'has'.$method}('bar'), 'has'.$method);
39  $this->assertTrue($handler->{'has'.$method}($record), 'has'.$method);
40  $this->assertTrue($handler->{'has'.$method}('test'.$method), 'has'.$method);
41  $this->assertTrue($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains');
42  $this->assertTrue($handler->{'has'.$method.'ThatPasses'}(function ($rec) {
43  return true;
44  }), 'has'.$method.'ThatPasses');
45  $this->assertTrue($handler->{'has'.$method.'ThatMatches'}('/test\w+/'));
46  $this->assertTrue($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records');
47 
48  $records = $handler->getRecords();
49  unset($records[0]['formatted']);
50  $this->assertEquals(array($record), $records);
51  }
$records
Definition: simple_test.php:22
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:

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