/
jagepard
/
Rudra-Exception
Обзор
Документация
Войти
/
jagepard
/
Rudra-Exception
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/ExceptionTest.php
61 строка
2 KB
Jagepard
fix
23 июн 2026, 15:06
23 июн 2026, 15:06
7d2fe8a
Код
Авторство
О чём код?
<?php declare(strict_types=1); /** * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. * * @author Korotkov Danila (Jagepard) <jagepard@yandex.ru> * @license https://mozilla.org/MPL/2.0/ MPL-2.0 */ use Rudra\Exceptions\LogicException; use Rudra\Exceptions\RudraException; use Rudra\Exceptions\RouterException; use Rudra\Exceptions\RuntimeException; use Rudra\Exceptions\NotFoundException; use Rudra\Exceptions\MiddlewareException; class ExceptionTest extends \PHPUnit\Framework\TestCase { protected function tearDown(): void { restore_exception_handler(); } public function testLogicException() { $this->expectException(LogicException::class); throw new LogicException("Some message"); } public function testNotFoundException() { $this->expectException(NotFoundException::class); throw new NotFoundException("Some message"); } public function testRouterException() { $this->expectException(RouterException::class); throw new RouterException("404"); } public function testRudraException() { $this->expectException(RudraException::class); throw new RudraException("Some message"); } public function testRuntimeException() { $this->expectException(RuntimeException::class); throw new RuntimeException("Some message"); } public function testMiddlewareException() { $this->expectException(MiddlewareException::class); throw new MiddlewareException("Some message"); } }