diff --git a/composer.json b/composer.json index bdc56f4..e81f8c7 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "allure-framework/allure-php-commons": "^2.0", + "allure-framework/allure-php-commons": "^2.4", "phpunit/phpunit": "^10.0.5 || ^11 || ^12.0.1 || ^13" }, "require-dev": { diff --git a/src/Event/TestConsideredRiskySubscriber.php b/src/Event/TestConsideredRiskySubscriber.php index 9e0daea..ff3efd8 100644 --- a/src/Event/TestConsideredRiskySubscriber.php +++ b/src/Event/TestConsideredRiskySubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(ConsideredRisky $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateStatus($event->message(), Status::failed()); } } diff --git a/src/Event/TestErroredSubscriber.php b/src/Event/TestErroredSubscriber.php index 2277ca0..acb1e46 100644 --- a/src/Event/TestErroredSubscriber.php +++ b/src/Event/TestErroredSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(Errored $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateDetectedStatus($event->throwable()->message(), Status::broken()); } } diff --git a/src/Event/TestFailedSubscriber.php b/src/Event/TestFailedSubscriber.php index 9cd7bda..9865fde 100644 --- a/src/Event/TestFailedSubscriber.php +++ b/src/Event/TestFailedSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(Failed $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateDetectedStatus($event->throwable()->message(), Status::failed(), Status::failed()); } } diff --git a/src/Event/TestFinishedSubscriber.php b/src/Event/TestFinishedSubscriber.php index 4d5af8d..3104f4a 100644 --- a/src/Event/TestFinishedSubscriber.php +++ b/src/Event/TestFinishedSubscriber.php @@ -20,14 +20,13 @@ public function __construct( public function notify(Finished $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->stop() ->updateRunInfo() ->write(); diff --git a/src/Event/TestMarkedIncompleteSubscriber.php b/src/Event/TestMarkedIncompleteSubscriber.php index b731ad1..fe4b1f5 100644 --- a/src/Event/TestMarkedIncompleteSubscriber.php +++ b/src/Event/TestMarkedIncompleteSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(MarkedIncomplete $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateStatus($event->throwable()->message(), Status::broken()); } } diff --git a/src/Event/TestPassedSubscriber.php b/src/Event/TestPassedSubscriber.php index f0734ec..61f3296 100644 --- a/src/Event/TestPassedSubscriber.php +++ b/src/Event/TestPassedSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(Passed $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateStatus(status: Status::passed()); } } diff --git a/src/Event/TestPreparationStartedSubscriber.php b/src/Event/TestPreparationStartedSubscriber.php index 7511453..d1da65f 100644 --- a/src/Event/TestPreparationStartedSubscriber.php +++ b/src/Event/TestPreparationStartedSubscriber.php @@ -20,14 +20,13 @@ public function __construct( public function notify(PreparationStarted $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->reset() ->create(); } diff --git a/src/Event/TestPreparedSubscriber.php b/src/Event/TestPreparedSubscriber.php index 93b7ee9..14dd9ae 100644 --- a/src/Event/TestPreparedSubscriber.php +++ b/src/Event/TestPreparedSubscriber.php @@ -20,14 +20,13 @@ public function __construct( public function notify(Prepared $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateInfo() ->start(); } diff --git a/src/Event/TestSkippedSubscriber.php b/src/Event/TestSkippedSubscriber.php index 0188ee3..5b62baf 100644 --- a/src/Event/TestSkippedSubscriber.php +++ b/src/Event/TestSkippedSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(Skipped $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test->nameWithClass() : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method) + ->switchTo($test) ->updateStatus($event->message(), Status::skipped()); } } diff --git a/src/Event/TestWarningTriggeredSubscriber.php b/src/Event/TestWarningTriggeredSubscriber.php index 4d00c13..69f5020 100644 --- a/src/Event/TestWarningTriggeredSubscriber.php +++ b/src/Event/TestWarningTriggeredSubscriber.php @@ -21,14 +21,13 @@ public function __construct( public function notify(WarningTriggered $event): void { $test = $event->test(); - $method = $test instanceof TestMethod ? $test : null; - if (!isset($method)) { + if (!$test instanceof TestMethod) { return; } $this ->testLifecycle - ->switchTo($method->nameWithClass()) + ->switchTo($test) ->updateStatus($event->message(), Status::broken()); } } diff --git a/src/Internal/TestInfo.php b/src/Internal/TestInfo.php index 8a8cea2..1b89418 100644 --- a/src/Internal/TestInfo.php +++ b/src/Internal/TestInfo.php @@ -4,6 +4,10 @@ namespace Qameta\Allure\PHPUnit\Internal; +use function array_filter; +use function explode; +use function is_string; + /** * @internal */ @@ -57,6 +61,16 @@ public function getFullName(): ?string : null; } + /** + * @return array + */ + public function getTitlePath(): array + { + return is_string($this->class) + ? [...array_filter(explode("\\", $this->class))] + : []; + } + public function getName(): string { return $this->getFullName() ?? $this->getTest(); diff --git a/src/Internal/TestLifecycle.php b/src/Internal/TestLifecycle.php index 5392c3e..94f91ef 100644 --- a/src/Internal/TestLifecycle.php +++ b/src/Internal/TestLifecycle.php @@ -4,6 +4,7 @@ namespace Qameta\Allure\PHPUnit\Internal; +use PHPUnit\Event\Code\TestMethod; use Qameta\Allure\AllureLifecycleInterface; use Qameta\Allure\Model\ResultFactoryInterface; use Qameta\Allure\Model\Status; @@ -16,6 +17,7 @@ use function array_pad; use function class_exists; use function explode; +use function is_int; use function preg_match; /** @@ -146,7 +148,7 @@ public function updateDetectedStatus( } #[\Override] - public function switchTo(string $test): self + public function switchTo(TestMethod $test): self { $thread = $this->threadDetector->getThread(); $this->lifecycle->switchThread($thread); @@ -173,42 +175,22 @@ private function getCurrentTest(): TestInfo return $this->currentTest ?? throw new RuntimeException("Current test is not set"); } - private function buildTestInfo(string $test, ?string $host = null, ?string $thread = null): TestInfo + private function buildTestInfo(TestMethod $test, ?string $host = null, ?string $thread = null): TestInfo { - /** @var list $matches */ - $classAndMethodMatchResult = preg_match( - '#^(\S+)(.*)$#', - $test, - $matches, - ); - [$classAndMethod, $dataSetInfo] = 1 === $classAndMethodMatchResult - ? [$matches[1] ?? null, $matches[2] ?? null] - : [$test, null]; - $dataLabelMatchResult = isset($dataSetInfo) - ? preg_match( - '/^\s+with\s+data\s+set\s+(?:(#\d+)|"(.*)")$/', - $dataSetInfo, - $matches, - ) - : false; - $dataLabel = 1 === $dataLabelMatchResult - ? $matches[2] ?? $matches[1] ?? null - : null; - if ('' === $dataLabel) { - $dataLabel = null; - } + $className = $test->className(); + $methodName = $test->methodName(); - /** @psalm-suppress PossiblyUndefinedArrayOffset */ - [$class, $method] = isset($classAndMethod) - ? array_pad(explode('::', $classAndMethod, 2), 2, null) - : [null, null]; + $testData = $test->testData(); + $dataSetName = $testData->hasDataFromDataProvider() + ? $testData->dataFromDataProvider()->dataSetName() + : null; /** @psalm-suppress MixedArgument */ return new TestInfo( - test: $test, - class: isset($class) && class_exists($class) ? $class : null, - method: $method, - dataLabel: $dataLabel, + test: $test->nameWithClass(), + class: class_exists($className) ? $className : null, + method: $methodName, + dataLabel: is_int($dataSetName) ? "#" . $dataSetName : $dataSetName, host: $host, thread: $thread, ); diff --git a/src/Internal/TestLifecycleInterface.php b/src/Internal/TestLifecycleInterface.php index b6573a3..b5a2fa2 100644 --- a/src/Internal/TestLifecycleInterface.php +++ b/src/Internal/TestLifecycleInterface.php @@ -4,6 +4,7 @@ namespace Qameta\Allure\PHPUnit\Internal; +use PHPUnit\Event\Code\TestMethod; use Qameta\Allure\Model\Status; interface TestLifecycleInterface @@ -28,7 +29,7 @@ public function updateDetectedStatus( ?Status $overrideStatus = null, ): TestLifecycleInterface; - public function switchTo(string $test): TestLifecycleInterface; + public function switchTo(TestMethod $test): TestLifecycleInterface; public function reset(): TestLifecycleInterface; } diff --git a/src/Internal/TestUpdater.php b/src/Internal/TestUpdater.php index 222942d..824caa3 100644 --- a/src/Internal/TestUpdater.php +++ b/src/Internal/TestUpdater.php @@ -38,6 +38,7 @@ public function setInfo(TestResult $testResult, TestInfo $info): void $testResult ->setName($parser->getDisplayName() ?? $info->getName()) ->setFullName($info->getFullName()) + ->setTitlePath(...$info->getTitlePath()) ->setDescriptionHtml($parser->getDescriptionHtml()) ->setDescription($parser->getDescription()) ->addLabels( diff --git a/test/unit/Event/TestConsideredRiskySubscriberTest.php b/test/unit/Event/TestConsideredRiskySubscriberTest.php index 4d23621..5170ca2 100644 --- a/test/unit/Event/TestConsideredRiskySubscriberTest.php +++ b/test/unit/Event/TestConsideredRiskySubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesStatusAsFailedForSwitchedConte { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestConsideredRiskySubscriber($testLifecycle); - $event = $this->createTestConsideredRiskyEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestConsideredRiskyEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestErroredSubscriberTest.php b/test/unit/Event/TestErroredSubscriberTest.php index 7c8dbee..1699d5d 100644 --- a/test/unit/Event/TestErroredSubscriberTest.php +++ b/test/unit/Event/TestErroredSubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesDetectedStatusAsBrokenForSwitc { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestErroredSubscriber($testLifecycle); - $event = $this->createTestErroredEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestErroredEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestFailedSubscriberTest.php b/test/unit/Event/TestFailedSubscriberTest.php index e8cbf81..17bd71d 100644 --- a/test/unit/Event/TestFailedSubscriberTest.php +++ b/test/unit/Event/TestFailedSubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesDetectedStatusAsFailedForSwitc { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestFailedSubscriber($testLifecycle); - $event = $this->createTestFailedEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestFailedEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestFinishedSubscriberTest.php b/test/unit/Event/TestFinishedSubscriberTest.php index 3d77db0..76c0ab5 100644 --- a/test/unit/Event/TestFinishedSubscriberTest.php +++ b/test/unit/Event/TestFinishedSubscriberTest.php @@ -33,15 +33,14 @@ public function testNotify_ValidTestMethod_WritesUpdatedStoppedTestAfterSwitchin { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestFinishedSubscriber($testLifecycle); - $event = $this->createTestFinishedEvent( - $this->createTestMethod(class: 'a', methodName: 'b'), - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestFinishedEvent($test); $lastMethod = null; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$lastMethod, $testLifecycle) { $lastMethod = "switchTo"; diff --git a/test/unit/Event/TestMarkedIncompleteSubscriberTest.php b/test/unit/Event/TestMarkedIncompleteSubscriberTest.php index 31be157..45e2a97 100644 --- a/test/unit/Event/TestMarkedIncompleteSubscriberTest.php +++ b/test/unit/Event/TestMarkedIncompleteSubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesStatusAsBrokenForSwitchedConte { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestMarkedIncompleteSubscriber($testLifecycle); - $event = $this->createTestMarkedIncompleteEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestMarkedIncompleteEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestPassedSubscriberTest.php b/test/unit/Event/TestPassedSubscriberTest.php index 5d2586d..96552dc 100644 --- a/test/unit/Event/TestPassedSubscriberTest.php +++ b/test/unit/Event/TestPassedSubscriberTest.php @@ -34,15 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesStatusAsPassedForSwitchedConte { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestPassedSubscriber($testLifecycle); - $event = $this->createTestPassesEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestPassesEvent($test); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestPreparationStartedSubscriberTest.php b/test/unit/Event/TestPreparationStartedSubscriberTest.php index 14fc306..263c986 100644 --- a/test/unit/Event/TestPreparationStartedSubscriberTest.php +++ b/test/unit/Event/TestPreparationStartedSubscriberTest.php @@ -33,15 +33,14 @@ public function testNotify_ValidTestMethod_CreatesTestAfterResettingSwitchedCont { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestPreparationStartedSubscriber($testLifecycle); - $event = $this->createTestPreparationStartedEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestPreparationStartedEvent($test); $lastMethod = null; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$lastMethod, $testLifecycle) { $lastMethod = "switchTo"; diff --git a/test/unit/Event/TestPreparedSubscriberTest.php b/test/unit/Event/TestPreparedSubscriberTest.php index 7603ee2..010afcc 100644 --- a/test/unit/Event/TestPreparedSubscriberTest.php +++ b/test/unit/Event/TestPreparedSubscriberTest.php @@ -33,15 +33,14 @@ public function testNotify_ValidTestMethod_StartsTestsWithUpdatedInfoInSwitchedC { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestPreparedSubscriber($testLifecycle); - $event = $this->createTestPreparedEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestPreparedEvent($test); $lastMethod = null; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$lastMethod, $testLifecycle) { $lastMethod = "switchTo"; diff --git a/test/unit/Event/TestSkippedSubscriberTest.php b/test/unit/Event/TestSkippedSubscriberTest.php index 0c428c3..ef4a94e 100644 --- a/test/unit/Event/TestSkippedSubscriberTest.php +++ b/test/unit/Event/TestSkippedSubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesStatusAsSkippedForSwitchedCont { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestSkippedSubscriber($testLifecycle); - $event = $this->createTestSkippedEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestSkippedEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Event/TestWarningTriggeredSubscriberTest.php b/test/unit/Event/TestWarningTriggeredSubscriberTest.php index 14ae436..daa4eba 100644 --- a/test/unit/Event/TestWarningTriggeredSubscriberTest.php +++ b/test/unit/Event/TestWarningTriggeredSubscriberTest.php @@ -34,16 +34,14 @@ public function testNotify_ValidTestMethod_UpdatesStatusAsBrokenForSwitchedConte { $testLifecycle = $this->createMock(TestLifecycleInterface::class); $subscriber = new TestWarningTriggeredSubscriber($testLifecycle); - $event = $this->createTestWarningTriggeredEvent( - test: $this->createTestMethod(class: 'a', methodName: 'b'), - message: 'c', - ); + $test = $this->createTestMethod(class: 'a', methodName: 'b'); + $event = $this->createTestWarningTriggeredEvent($test, 'c'); $switched = false; $testLifecycle ->expects(self::once()) ->method('switchTo') - ->with(self::identicalTo('a::b')) + ->with(self::identicalTo($test)) ->willReturnCallback( function () use (&$switched, $testLifecycle) { $switched = true; diff --git a/test/unit/Internal/TestInfoTest.php b/test/unit/Internal/TestInfoTest.php index b2257f1..4e9a20a 100644 --- a/test/unit/Internal/TestInfoTest.php +++ b/test/unit/Internal/TestInfoTest.php @@ -156,6 +156,43 @@ public static function providerGetFullName(): iterable ]; } + /** + * @param string|null $class + * @param list $expectedTitlePath + * @psalm-suppress ArgumentTypeCoercion + */ + #[DataProvider('providerGetTitlePath')] + public function testGetGetTitlePath_ConstructedWithGivenClass_ReturnsMatchingValue( + ?string $class, + array $expectedTitlePath, + ): void { + $info = new TestInfo( + test: 'a', + class: $class, + method: null, + dataLabel: null, + host: null, + thread: null, + ); + self::assertEquals($expectedTitlePath, $info->getTitlePath()); + } + + /** + * @return iterable}> + */ + public static function providerGetTitlePath(): iterable + { + return [ + "null class" => [null, []], + "empty class" => ["", []], + "no namespace" => ["Foo", ["Foo"]], + "one namespace" => ["Foo\\Bar", ["Foo", "Bar"]], + "nested namespaces" => ["Foo\\Bar\\Baz\\Qux", ["Foo", "Bar", "Baz", "Qux"]], + "absolute namespace path" => ["\\Foo\\Bar", ["Foo", "Bar"]], + "empty namespaces" => ["\\Foo\\\\Bar", ["Foo", "Bar"]], + ]; + } + /** * @param string $test * @param class-string|null $class diff --git a/test/unit/TestTestLifecycle.php b/test/unit/TestTestLifecycle.php index 0457463..33d7545 100644 --- a/test/unit/TestTestLifecycle.php +++ b/test/unit/TestTestLifecycle.php @@ -4,6 +4,7 @@ namespace Qameta\Allure\PHPUnit\Test\Unit; +use PHPUnit\Event\Code\TestMethod; use Qameta\Allure\Model\Status; use Qameta\Allure\PHPUnit\Internal\TestLifecycleInterface; @@ -34,7 +35,7 @@ public function stop(): TestLifecycleInterface } #[\Override] - public function switchTo(string $test): TestLifecycleInterface + public function switchTo(TestMethod $test): TestLifecycleInterface { return $this; }