ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
SamplingHandlerTest.php
Go to the documentation of this file.
1
<?
php
2
3
/*
4
* This file is part of the Monolog package.
5
*
6
* (c) Jordi Boggiano <j.boggiano@seld.be>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace
Monolog\Handler
;
13
14
use
Monolog\TestCase
;
15
19
class
SamplingHandlerTest
extends
TestCase
20
{
21
public
function
testHandle
()
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
}
33
}
Monolog\Handler
Definition:
AbstractHandler.php:12
Monolog\Handler\SamplingHandlerTest
Monolog::handle
Definition:
SamplingHandlerTest.php:19
TestCase
Monolog\TestCase\getRecord
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition:
TestCase.php:19
Monolog\Handler\SamplingHandler
Sampling handler.
Definition:
SamplingHandler.php:28
Monolog\Handler\SamplingHandlerTest\testHandle
testHandle()
Definition:
SamplingHandlerTest.php:21
php
Monolog\Handler\TestHandler
Used for testing purposes.
Definition:
TestHandler.php:66
Monolog\TestCase
Definition:
TestCase.php:14
libs
composer
vendor
monolog
monolog
tests
Monolog
Handler
SamplingHandlerTest.php
Generated on Fri Feb 21 2025 19:00:53 for ILIAS by
1.8.13 (using
Doxyfile
)