ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Monolog\Handler\SamplingHandlerTest Class Reference

@covers Monolog\Handler\SamplingHandler::handle More...

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

Public Member Functions

 testHandle ()
 

Additional Inherited Members

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

Detailed Description

@covers Monolog\Handler\SamplingHandler::handle

Definition at line 19 of file SamplingHandlerTest.php.

Member Function Documentation

◆ testHandle()

Monolog\Handler\SamplingHandlerTest::testHandle ( )

Definition at line 21 of file SamplingHandlerTest.php.

22 {
23 $testHandler = new TestHandler();
24 $handler = new SamplingHandler($testHandler, 2);
25 for ($i = 0; $i < 10000; $i++) {
26 $handler->handle($this->getRecord());
27 }
28 $count = count($testHandler->getRecords());
29 // $count should be half of 10k, so between 4k and 6k
30 $this->assertLessThan(6000, $count);
31 $this->assertGreaterThan(4000, $count);
32 }
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19

References Monolog\TestCase\getRecord().

+ Here is the call graph for this function:

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