/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpKernel/Tests/Attribute/WithLogLevelTest.php
39 строк
951 B
Dejan Angelov
[HttpKernel] Allow using `#[WithLogLevel]` for setting custom log level for exceptions
05 янв 2023, 09:42
05 янв 2023, 09:42
0a2563d
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\Attribute; use PHPUnit\Framework\TestCase; use Psr\Log\LogLevel; use Symfony\Component\HttpKernel\Attribute\WithLogLevel; /** * @author Dejan Angelov <angelovdejan@protonmail.com> */ class WithLogLevelTest extends TestCase { public function testWithValidLogLevel() { $logLevel = LogLevel::NOTICE; $attribute = new WithLogLevel($logLevel); $this->assertSame($logLevel, $attribute->level); } public function testWithInvalidLogLevel() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid log level "invalid".'); new WithLogLevel('invalid'); } }