/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpKernel/Tests/Controller/TraceableControllerResolverTest.php
44 строки
1 KB
Roy de Vos Burchart
Code style change in `@PER-CS2.0` affecting `@Symfony` (parentheses for anonymous classes)
06 авг 2024, 13:13
06 авг 2024, 13:13
506e0dd
Код
Авторство
О чём код?
<?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 Controller; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; use Symfony\Component\HttpKernel\Controller\TraceableControllerResolver; use Symfony\Component\Stopwatch\Stopwatch; use Symfony\Component\Stopwatch\StopwatchEvent; class TraceableControllerResolverTest extends TestCase { public function testStopwatchEventIsStoppedWhenResolverThrows() { $stopwatchEvent = $this->createMock(StopwatchEvent::class); $stopwatchEvent->expects(self::once())->method('stop'); $stopwatch = $this->createStub(Stopwatch::class); $stopwatch->method('start')->willReturn($stopwatchEvent); $resolver = new class implements ControllerResolverInterface { public function getController(Request $request): callable|false { throw new \Exception(); } }; $traceableResolver = new TraceableControllerResolver($resolver, $stopwatch); try { $traceableResolver->getController(new Request()); } catch (\Exception $ex) { } } }