/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpKernel/Tests/Controller/TraceableArgumentResolverTest.php
45 строк
1 KB
Dariusz Ruminski
PHP CS Fixer: enable static_lambda
19 дек 2025, 11:33
19 дек 2025, 11:33
3274fbc
Код
Авторство
О чём код?
<?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\ArgumentResolverInterface; use Symfony\Component\HttpKernel\Controller\TraceableArgumentResolver; use Symfony\Component\Stopwatch\Stopwatch; use Symfony\Component\Stopwatch\StopwatchEvent; class TraceableArgumentResolverTest 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 ArgumentResolverInterface { public function getArguments(Request $request, callable $controller, ?\ReflectionFunctionAbstract $reflector = null): array { throw new \Exception(); } }; $traceableResolver = new TraceableArgumentResolver($resolver, $stopwatch); try { $traceableResolver->getArguments(new Request(), static function () {}); } catch (\Exception $ex) { } } }