mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Rename TestCase to MonologTestCase (#1953)
This commit is contained in:
71
src/Monolog/Test/MonologTestCase.php
Normal file
71
src/Monolog/Test/MonologTestCase.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the Monolog package.
|
||||
*
|
||||
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Monolog\Test;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Logger;
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\JsonSerializableDateTimeImmutable;
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* Lets you easily generate log records and a dummy formatter for testing purposes
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*/
|
||||
class MonologTestCase extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @param array<mixed> $context
|
||||
* @param array<mixed> $extra
|
||||
*
|
||||
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
|
||||
*/
|
||||
protected function getRecord(int|string|Level $level = Level::Warning, string|\Stringable $message = 'test', array $context = [], string $channel = 'test', \DateTimeImmutable $datetime = new JsonSerializableDateTimeImmutable(true), array $extra = []): LogRecord
|
||||
{
|
||||
return new LogRecord(
|
||||
message: (string) $message,
|
||||
context: $context,
|
||||
level: Logger::toMonologLevel($level),
|
||||
channel: $channel,
|
||||
datetime: $datetime,
|
||||
extra: $extra,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return list<LogRecord>
|
||||
*/
|
||||
protected function getMultipleRecords(): array
|
||||
{
|
||||
return [
|
||||
$this->getRecord(Level::Debug, 'debug message 1'),
|
||||
$this->getRecord(Level::Debug, 'debug message 2'),
|
||||
$this->getRecord(Level::Info, 'information'),
|
||||
$this->getRecord(Level::Warning, 'warning'),
|
||||
$this->getRecord(Level::Error, 'error'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getIdentityFormatter(): FormatterInterface
|
||||
{
|
||||
$formatter = $this->createMock(FormatterInterface::class);
|
||||
$formatter->expects(self::any())
|
||||
->method('format')
|
||||
->willReturnCallback(function ($record) {
|
||||
return $record->message;
|
||||
});
|
||||
|
||||
return $formatter;
|
||||
}
|
||||
}
|
@@ -11,64 +11,13 @@
|
||||
|
||||
namespace Monolog\Test;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Logger;
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\JsonSerializableDateTimeImmutable;
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
use ReflectionProperty;
|
||||
|
||||
/**
|
||||
* Lets you easily generate log records and a dummy formatter for testing purposes
|
||||
*
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* @internal feel free to reuse this to test your own handlers, this is marked internal to avoid issues with PHPStorm https://github.com/Seldaek/monolog/issues/1677
|
||||
* @deprecated use MonologTestCase instead.
|
||||
*/
|
||||
class TestCase extends \PHPUnit\Framework\TestCase
|
||||
class TestCase extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @param array<mixed> $context
|
||||
* @param array<mixed> $extra
|
||||
*
|
||||
* @phpstan-param value-of<Level::VALUES>|value-of<Level::NAMES>|Level|LogLevel::* $level
|
||||
*/
|
||||
protected function getRecord(int|string|Level $level = Level::Warning, string|\Stringable $message = 'test', array $context = [], string $channel = 'test', \DateTimeImmutable $datetime = new JsonSerializableDateTimeImmutable(true), array $extra = []): LogRecord
|
||||
{
|
||||
return new LogRecord(
|
||||
message: (string) $message,
|
||||
context: $context,
|
||||
level: Logger::toMonologLevel($level),
|
||||
channel: $channel,
|
||||
datetime: $datetime,
|
||||
extra: $extra,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return list<LogRecord>
|
||||
*/
|
||||
protected function getMultipleRecords(): array
|
||||
{
|
||||
return [
|
||||
$this->getRecord(Level::Debug, 'debug message 1'),
|
||||
$this->getRecord(Level::Debug, 'debug message 2'),
|
||||
$this->getRecord(Level::Info, 'information'),
|
||||
$this->getRecord(Level::Warning, 'warning'),
|
||||
$this->getRecord(Level::Error, 'error'),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getIdentityFormatter(): FormatterInterface
|
||||
{
|
||||
$formatter = $this->createMock(FormatterInterface::class);
|
||||
$formatter->expects(self::any())
|
||||
->method('format')
|
||||
->willReturnCallback(function ($record) {
|
||||
return $record->message;
|
||||
});
|
||||
|
||||
return $formatter;
|
||||
}
|
||||
}
|
||||
|
@@ -11,12 +11,10 @@
|
||||
|
||||
namespace Monolog\Attribute;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @requires PHP 8.0
|
||||
*/
|
||||
final class AsMonologProcessorTest extends TestCase
|
||||
final class AsMonologProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Attribute;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class WithMonologChannelTest extends TestCase
|
||||
class WithMonologChannelTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class ChromePHPFormatterTest extends TestCase
|
||||
class ChromePHPFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\ChromePHPFormatter::format
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class ElasticaFormatterTest extends TestCase
|
||||
class ElasticaFormatterTest extends MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class ElasticsearchFormatterTest extends TestCase
|
||||
class ElasticsearchFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\ElasticsearchFormatter::__construct
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class FlowdockFormatterTest extends TestCase
|
||||
class FlowdockFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\FlowdockFormatter::format
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class FluentdFormatterTest extends TestCase
|
||||
class FluentdFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\FluentdFormatter::__construct
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class GelfMessageFormatterTest extends TestCase
|
||||
class GelfMessageFormatterTest extends MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -12,10 +12,10 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
use function json_decode;
|
||||
|
||||
class GoogleCloudLoggingFormatterTest extends TestCase
|
||||
class GoogleCloudLoggingFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
|
@@ -14,9 +14,9 @@ namespace Monolog\Formatter;
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
use JsonSerializable;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class JsonFormatterTest extends TestCase
|
||||
class JsonFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\JsonFormatter::__construct
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use RuntimeException;
|
||||
@@ -19,7 +19,7 @@ use RuntimeException;
|
||||
/**
|
||||
* @covers Monolog\Formatter\LineFormatter
|
||||
*/
|
||||
class LineFormatterTest extends TestCase
|
||||
class LineFormatterTest extends MonologTestCase
|
||||
{
|
||||
public function testDefFormatWithString()
|
||||
{
|
||||
|
@@ -11,9 +11,9 @@
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class LogglyFormatterTest extends TestCase
|
||||
class LogglyFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\LogglyFormatter::__construct
|
||||
|
@@ -11,12 +11,12 @@
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
/**
|
||||
* @author Julien Breux <julien.breux@gmail.com>
|
||||
*/
|
||||
class LogmaticFormatterTest extends TestCase
|
||||
class LogmaticFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\LogmaticFormatter::format
|
||||
|
@@ -12,9 +12,9 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
|
||||
class LogstashFormatterTest extends TestCase
|
||||
class LogstashFormatterTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\LogstashFormatter::format
|
||||
|
@@ -15,13 +15,12 @@ use MongoDB\BSON\ObjectId;
|
||||
use MongoDB\BSON\Regex;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @author Florian Plattner <me@florianplattner.de>
|
||||
*/
|
||||
class MongoDBFormatterTest extends TestCase
|
||||
class MongoDBFormatterTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -11,13 +11,12 @@
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Formatter\NormalizerFormatter
|
||||
*/
|
||||
class NormalizerFormatterTest extends TestCase
|
||||
class NormalizerFormatterTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testFormat()
|
||||
{
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\JsonSerializableDateTimeImmutable;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class ScalarFormatterTest extends TestCase
|
||||
class ScalarFormatterTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private ScalarFormatter $formatter;
|
||||
|
||||
|
@@ -15,9 +15,8 @@ use DateTimeImmutable;
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SyslogFormatterTest extends TestCase
|
||||
class SyslogFormatterTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @param mixed[] $context
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class WildfireFormatterTest extends TestCase
|
||||
class WildfireFormatterTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Formatter\WildfireFormatter::format
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class AbstractHandlerTest extends TestCase
|
||||
class AbstractHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\AbstractHandler::__construct
|
||||
|
@@ -11,12 +11,11 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Processor\WebProcessor;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
|
||||
class AbstractProcessingHandlerTest extends TestCase
|
||||
class AbstractProcessingHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\FormattableHandlerTrait::getFormatter
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PhpAmqpLib\Message\AMQPMessage;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\RotatingFileHandler
|
||||
*/
|
||||
class AmqpHandlerTest extends TestCase
|
||||
class AmqpHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testHandleAmqpExt()
|
||||
{
|
||||
|
@@ -11,13 +11,12 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\BrowserConsoleHandlerTest
|
||||
*/
|
||||
class BrowserConsoleHandlerTest extends TestCase
|
||||
class BrowserConsoleHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -11,10 +11,9 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class BufferHandlerTest extends TestCase
|
||||
class BufferHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private TestHandler $shutdownCheckHandler;
|
||||
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\ChromePHPHandler
|
||||
*/
|
||||
class ChromePHPHandlerTest extends TestCase
|
||||
class ChromePHPHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -11,10 +11,9 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class CouchDBHandlerTest extends TestCase
|
||||
class CouchDBHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testHandle()
|
||||
{
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class DeduplicationHandlerTest extends TestCase
|
||||
class DeduplicationHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\DeduplicationHandler::flush
|
||||
|
@@ -11,10 +11,9 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class DoctrineCouchDBHandlerTest extends TestCase
|
||||
class DoctrineCouchDBHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -12,10 +12,9 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Aws\DynamoDb\DynamoDbClient;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
class DynamoDbHandlerTest extends TestCase
|
||||
class DynamoDbHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private DynamoDbClient&MockObject $client;
|
||||
|
||||
|
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\ElasticaFormatter;
|
||||
use Monolog\Formatter\NormalizerFormatter;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Elastica\Client;
|
||||
use Elastica\Request;
|
||||
@@ -22,7 +21,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('Elastica')]
|
||||
class ElasticaHandlerTest extends TestCase
|
||||
class ElasticaHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var Client mock
|
||||
|
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\ElasticsearchFormatter;
|
||||
use Monolog\Formatter\NormalizerFormatter;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Elasticsearch\Client;
|
||||
use Elastic\Elasticsearch\Client as Client8;
|
||||
@@ -25,7 +24,7 @@ use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('Elasticsearch')]
|
||||
#[CoversClass(ElasticsearchHandler::class)]
|
||||
class ElasticsearchHandlerTest extends TestCase
|
||||
class ElasticsearchHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected Client|Client8 $client;
|
||||
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
|
||||
@@ -20,7 +19,7 @@ function error_log()
|
||||
$GLOBALS['error_log'][] = \func_get_args();
|
||||
}
|
||||
|
||||
class ErrorLogHandlerTest extends TestCase
|
||||
class ErrorLogHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -13,9 +13,8 @@ namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class FallbackGroupHandlerTest extends TestCase
|
||||
class FallbackGroupHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\FallbackGroupHandler::__construct
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class FilterHandlerTest extends TestCase
|
||||
class FilterHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\FilterHandler::isHandling
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
|
||||
use Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
class FingersCrossedHandlerTest extends TestCase
|
||||
class FingersCrossedHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\FingersCrossedHandler::__construct
|
||||
|
@@ -11,13 +11,12 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\FirePHPHandler
|
||||
*/
|
||||
class FirePHPHandlerTest extends TestCase
|
||||
class FirePHPHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -13,12 +13,11 @@ namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Monolog\Handler\FleepHookHandler
|
||||
*/
|
||||
class FleepHookHandlerTest extends TestCase
|
||||
class FleepHookHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* Default token to use in tests
|
||||
|
@@ -12,14 +12,13 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\FlowdockFormatter;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
/**
|
||||
* @author Dominik Liebler <liebler.dominik@gmail.com>
|
||||
* @see https://www.hipchat.com/docs/api
|
||||
*/
|
||||
class FlowdockHandlerTest extends TestCase
|
||||
class FlowdockHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
|
@@ -12,11 +12,10 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Gelf\Message;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\GelfMessageFormatter;
|
||||
|
||||
class GelfHandlerTest extends TestCase
|
||||
class GelfHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -12,10 +12,9 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class GroupHandlerTest extends TestCase
|
||||
class GroupHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\GroupHandler::__construct
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @author Alexey Karapetov <alexey@karapetov.com>
|
||||
*/
|
||||
class HandlerWrapperTest extends TestCase
|
||||
class HandlerWrapperTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private HandlerWrapper $wrapper;
|
||||
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
@@ -19,7 +18,7 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
* @author Robert Kaufmann III <rok3@rok3.me>
|
||||
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
|
||||
*/
|
||||
class InsightOpsHandlerTest extends TestCase
|
||||
class InsightOpsHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @author Robert Kaufmann III <rok3@rok3.me>
|
||||
*/
|
||||
class LogEntriesHandlerTest extends TestCase
|
||||
class LogEntriesHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @author Julien Breux <julien.breux@gmail.com>
|
||||
*/
|
||||
class LogmaticHandlerTest extends TestCase
|
||||
class LogmaticHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class MailHandlerTest extends TestCase
|
||||
class MailHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\MailHandler::handleBatch
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use MongoDB\Driver\Manager;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @requires extension mongodb
|
||||
*/
|
||||
class MongoDBHandlerTest extends TestCase
|
||||
class MongoDBHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testConstructorShouldThrowExceptionForInvalidMongo()
|
||||
{
|
||||
|
@@ -12,14 +12,13 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
function mail($to, $subject, $message, $additional_headers = null, $additional_parameters = null)
|
||||
{
|
||||
$GLOBALS['mail'][] = \func_get_args();
|
||||
}
|
||||
|
||||
class NativeMailerHandlerTest extends TestCase
|
||||
class NativeMailerHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
@@ -29,15 +28,17 @@ class NativeMailerHandlerTest extends TestCase
|
||||
protected function newNativeMailerHandler(... $args) : NativeMailerHandler
|
||||
{
|
||||
return new class(... $args) extends NativeMailerHandler {
|
||||
|
||||
public $mail = [];
|
||||
|
||||
protected function mail( string $to, string $subject, string $content,
|
||||
string $headers, string $parameters ) : void
|
||||
{
|
||||
protected function mail(
|
||||
string $to,
|
||||
string $subject,
|
||||
string $content,
|
||||
string $headers,
|
||||
string $parameters
|
||||
) : void {
|
||||
$this->mail[] = \func_get_args();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -12,10 +12,9 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class NewRelicHandlerTest extends TestCase
|
||||
class NewRelicHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public static $appname;
|
||||
public static $customParameters;
|
||||
|
@@ -12,13 +12,12 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\NoopHandler::handle
|
||||
*/
|
||||
class NoopHandlerTest extends TestCase
|
||||
class NoopHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
#[DataProvider('logLevelsProvider')]
|
||||
public function testIsHandling(Level $level)
|
||||
|
@@ -11,13 +11,12 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\NullHandler::handle
|
||||
*/
|
||||
class NullHandlerTest extends TestCase
|
||||
class NullHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testHandle()
|
||||
{
|
||||
|
@@ -12,13 +12,12 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @author Kris Buist <krisbuist@gmail.com>
|
||||
* @covers \Monolog\Handler\OverflowHandler
|
||||
*/
|
||||
class OverflowHandlerTest extends TestCase
|
||||
class OverflowHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testNotPassingRecordsBeneathLogLevel()
|
||||
{
|
||||
|
@@ -15,7 +15,6 @@ use Exception;
|
||||
use Monolog\ErrorHandler;
|
||||
use Monolog\Level;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Test\TestCase;
|
||||
use PhpConsole\Connector;
|
||||
use PhpConsole\Dispatcher\Debug as DebugDispatcher;
|
||||
use PhpConsole\Dispatcher\Errors as ErrorDispatcher;
|
||||
@@ -28,7 +27,7 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
* @covers Monolog\Handler\PHPConsoleHandler
|
||||
* @author Sergey Barbushin https://www.linkedin.com/in/barbushin
|
||||
*/
|
||||
class PHPConsoleHandlerTest extends TestCase
|
||||
class PHPConsoleHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
protected Connector&MockObject $connector;
|
||||
protected DebugDispatcher&MockObject $debugDispatcher;
|
||||
@@ -201,7 +200,7 @@ class PHPConsoleHandlerTest extends TestCase
|
||||
$handler = $this->initLogger();
|
||||
$handler->log(
|
||||
\Psr\Log\LogLevel::ERROR,
|
||||
sprintf('Uncaught Exception %s: "%s" at %s line %s', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
|
||||
\sprintf('Uncaught Exception %s: "%s" at %s line %s', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
|
||||
['exception' => $e]
|
||||
);
|
||||
}
|
||||
|
@@ -11,11 +11,10 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
class ProcessHandlerTest extends TestCase
|
||||
class ProcessHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* Dummy command to be used by tests that should not fail due to the command.
|
||||
|
@@ -12,14 +12,13 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\PsrHandler::handle
|
||||
*/
|
||||
class PsrHandlerTest extends TestCase
|
||||
class PsrHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public static function logLevelProvider()
|
||||
{
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
@@ -21,7 +20,7 @@ use PHPUnit\Framework\MockObject\MockObject;
|
||||
* @author Sebastian Göttschkes <sebastian.goettschkes@googlemail.com>
|
||||
* @see https://www.pushover.net/api
|
||||
*/
|
||||
class PushoverHandlerTest extends TestCase
|
||||
class PushoverHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/** @var resource */
|
||||
private $res;
|
||||
|
@@ -11,11 +11,10 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
|
||||
class RedisHandlerTest extends TestCase
|
||||
class RedisHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testConstructorShouldWorkWithPredis()
|
||||
{
|
||||
|
@@ -13,11 +13,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
|
||||
class RedisPubSubHandlerTest extends TestCase
|
||||
class RedisPubSubHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testConstructorShouldWorkWithPredis()
|
||||
{
|
||||
|
@@ -12,7 +12,6 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Exception;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Rollbar\RollbarLogger;
|
||||
@@ -25,7 +24,7 @@ use Rollbar\RollbarLogger;
|
||||
*
|
||||
* @requires function \Rollbar\RollbarLogger::__construct
|
||||
*/
|
||||
class RollbarHandlerTest extends TestCase
|
||||
class RollbarHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private RollbarLogger&MockObject $rollbarLogger;
|
||||
|
||||
|
@@ -12,13 +12,12 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\RotatingFileHandler
|
||||
*/
|
||||
class RotatingFileHandlerTest extends TestCase
|
||||
class RotatingFileHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private array|null $lastError = null;
|
||||
|
||||
@@ -84,15 +83,15 @@ class RotatingFileHandlerTest extends TestCase
|
||||
{
|
||||
if (empty($this->lastError)) {
|
||||
$this->fail(
|
||||
sprintf(
|
||||
\sprintf(
|
||||
'Failed asserting that error with code `%d` and message `%s` was triggered',
|
||||
$code,
|
||||
$message
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->assertEquals($code, $this->lastError['code'], sprintf('Expected an error with code %d to be triggered, got `%s` instead', $code, $this->lastError['code']));
|
||||
$this->assertEquals($message, $this->lastError['message'], sprintf('Expected an error with message `%d` to be triggered, got `%s` instead', $message, $this->lastError['message']));
|
||||
$this->assertEquals($code, $this->lastError['code'], \sprintf('Expected an error with code %d to be triggered, got `%s` instead', $code, $this->lastError['code']));
|
||||
$this->assertEquals($message, $this->lastError['message'], \sprintf('Expected an error with message `%d` to be triggered, got `%s` instead', $message, $this->lastError['message']));
|
||||
}
|
||||
|
||||
public function testRotationCreatesNewFile()
|
||||
|
@@ -11,12 +11,10 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\SamplingHandler::handle
|
||||
*/
|
||||
class SamplingHandlerTest extends TestCase
|
||||
class SamplingHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testHandle()
|
||||
{
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler\Slack;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
#[CoversClass(SlackRecord::class)]
|
||||
class SlackRecordTest extends TestCase
|
||||
class SlackRecordTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public static function dataGetAttachmentColor()
|
||||
{
|
||||
@@ -252,12 +251,12 @@ class SlackRecordTest extends TestCase
|
||||
[
|
||||
[
|
||||
'title' => 'Extra',
|
||||
'value' => sprintf('```%s```', json_encode($extra, JSON_PRETTY_PRINT)),
|
||||
'value' => \sprintf('```%s```', json_encode($extra, JSON_PRETTY_PRINT)),
|
||||
'short' => false,
|
||||
],
|
||||
[
|
||||
'title' => 'Context',
|
||||
'value' => sprintf('```%s```', json_encode($context, JSON_PRETTY_PRINT)),
|
||||
'value' => \sprintf('```%s```', json_encode($context, JSON_PRETTY_PRINT)),
|
||||
'short' => false,
|
||||
],
|
||||
],
|
||||
@@ -306,7 +305,7 @@ class SlackRecordTest extends TestCase
|
||||
],
|
||||
[
|
||||
'title' => 'Tags',
|
||||
'value' => sprintf('```%s```', json_encode($extra['tags'])),
|
||||
'value' => \sprintf('```%s```', json_encode($extra['tags'])),
|
||||
'short' => false,
|
||||
],
|
||||
[
|
||||
@@ -362,12 +361,12 @@ class SlackRecordTest extends TestCase
|
||||
$expected = [
|
||||
[
|
||||
'title' => 'Info',
|
||||
'value' => sprintf('```%s```', json_encode(['author' => 'Jordi'], JSON_PRETTY_PRINT)),
|
||||
'value' => \sprintf('```%s```', json_encode(['author' => 'Jordi'], JSON_PRETTY_PRINT)),
|
||||
'short' => false,
|
||||
],
|
||||
[
|
||||
'title' => 'Tags',
|
||||
'value' => sprintf('```%s```', json_encode(['web'])),
|
||||
'value' => \sprintf('```%s```', json_encode(['web'])),
|
||||
'short' => false,
|
||||
],
|
||||
];
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Handler\Slack\SlackRecord;
|
||||
@@ -21,7 +20,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
||||
* @author Greg Kedzierski <greg@gregkedzierski.com>
|
||||
* @see https://api.slack.com/
|
||||
*/
|
||||
class SlackHandlerTest extends TestCase
|
||||
class SlackHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
|
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Handler\Slack\SlackRecord;
|
||||
@@ -21,7 +20,7 @@ use Monolog\Handler\Slack\SlackRecord;
|
||||
* @see https://api.slack.com/incoming-webhooks
|
||||
* @coversDefaultClass Monolog\Handler\SlackWebhookHandler
|
||||
*/
|
||||
class SlackWebhookHandlerTest extends TestCase
|
||||
class SlackWebhookHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
const WEBHOOK_URL = 'https://hooks.slack.com/services/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E';
|
||||
|
||||
|
@@ -11,14 +11,13 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @author Pablo de Leon Belloc <pablolb@gmail.com>
|
||||
*/
|
||||
class SocketHandlerTest extends TestCase
|
||||
class SocketHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private SocketHandler&MockObject $handler;
|
||||
|
||||
|
@@ -11,11 +11,10 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
class StreamHandlerTest extends TestCase
|
||||
class StreamHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function tearDown(): void
|
||||
{
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
class SymfonyMailerHandlerTest extends TestCase
|
||||
class SymfonyMailerHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/** @var MailerInterface&MockObject */
|
||||
private $mailer;
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @requires extension sockets
|
||||
*/
|
||||
class SyslogUdpHandlerTest extends TestCase
|
||||
class SyslogUdpHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testWeValidateFacilities()
|
||||
{
|
||||
|
@@ -12,14 +12,13 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @author Mazur Alexandr <alexandrmazur96@gmail.com>
|
||||
* @link https://core.telegram.org/bots/api
|
||||
*/
|
||||
class TelegramBotHandlerTest extends TestCase
|
||||
class TelegramBotHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private TelegramBotHandler&MockObject $handler;
|
||||
|
||||
|
@@ -12,13 +12,12 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\TestHandler
|
||||
*/
|
||||
class TestHandlerTest extends TestCase
|
||||
class TestHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
#[DataProvider('methodProvider')]
|
||||
public function testHandler($method, Level $level)
|
||||
|
@@ -12,12 +12,11 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Handler\SyslogUdp\UdpSocket;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @requires extension sockets
|
||||
*/
|
||||
class UdpSocketTest extends TestCase
|
||||
class UdpSocketTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testWeDoNotTruncateShortMessages()
|
||||
{
|
||||
|
@@ -12,10 +12,9 @@
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\LogRecord;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Level;
|
||||
|
||||
class WhatFailureGroupHandlerTest extends TestCase
|
||||
class WhatFailureGroupHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Handler\WhatFailureGroupHandler::__construct
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Handler;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class ZendMonitorHandlerTest extends TestCase
|
||||
class ZendMonitorHandlerTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
|
@@ -14,10 +14,10 @@ namespace Monolog;
|
||||
use Monolog\Handler\HandlerInterface;
|
||||
use Monolog\Processor\WebProcessor;
|
||||
use Monolog\Handler\TestHandler;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
class LoggerTest extends TestCase
|
||||
class LoggerTest extends MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Logger::getName
|
||||
|
@@ -11,10 +11,9 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
class ClosureContextProcessorTest extends TestCase
|
||||
class ClosureContextProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testReplace()
|
||||
{
|
||||
|
@@ -12,9 +12,8 @@
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class GitProcessorTest extends TestCase
|
||||
class GitProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\GitProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class HostnameProcessorTest extends TestCase
|
||||
class HostnameProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\HostnameProcessor::__invoke
|
||||
|
@@ -27,10 +27,9 @@ function tester($handler, $record)
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use Monolog\Handler\TestHandler;
|
||||
|
||||
class IntrospectionProcessorTest extends TestCase
|
||||
class IntrospectionProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function getHandler()
|
||||
{
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class LoadAverageProcessorTest extends TestCase
|
||||
class LoadAverageProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\LoadAverageProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class MemoryPeakUsageProcessorTest extends TestCase
|
||||
class MemoryPeakUsageProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class MemoryUsageProcessorTest extends TestCase
|
||||
class MemoryUsageProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\MemoryUsageProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class MercurialProcessorTest extends TestCase
|
||||
class MercurialProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private string $oldCwd;
|
||||
private string $testDir;
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class ProcessIdProcessorTest extends TestCase
|
||||
class ProcessIdProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\ProcessIdProcessor::__invoke
|
||||
|
@@ -12,10 +12,9 @@
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Level;
|
||||
use Monolog\Test\TestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
class PsrLogMessageProcessorTest extends TestCase
|
||||
class PsrLogMessageProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
#[DataProvider('getPairs')]
|
||||
public function testReplacement($val, $expected)
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class TagProcessorTest extends TestCase
|
||||
class TagProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\TagProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class UidProcessorTest extends TestCase
|
||||
class UidProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Monolog\Processor\UidProcessor::__invoke
|
||||
|
@@ -11,9 +11,7 @@
|
||||
|
||||
namespace Monolog\Processor;
|
||||
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
class WebProcessorTest extends TestCase
|
||||
class WebProcessorTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
public function testProcessor()
|
||||
{
|
||||
|
@@ -17,13 +17,12 @@ use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\InvalidArgumentException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
use Stringable;
|
||||
|
||||
class PsrLogCompatTest extends TestCase
|
||||
class PsrLogCompatTest extends \Monolog\Test\MonologTestCase
|
||||
{
|
||||
private TestHandler $handler;
|
||||
|
||||
|
@@ -13,15 +13,15 @@ namespace Monolog;
|
||||
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\TestHandler;
|
||||
use Monolog\Test\MonologTestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Psr\Log\LogLevel;
|
||||
use Monolog\Test\TestCase;
|
||||
|
||||
/**
|
||||
* @author Robert Gust-Bardon <robert@gust-bardon.org>
|
||||
* @covers Monolog\SignalHandler
|
||||
*/
|
||||
class SignalHandlerTest extends TestCase
|
||||
class SignalHandlerTest extends MonologTestCase
|
||||
{
|
||||
private bool $asyncSignalHandling;
|
||||
private array $blockedSignals = [];
|
||||
|
Reference in New Issue
Block a user