Merge pull request #16564 from nextcloud/fix-phpunit-11-use-in-behat

test: Fix PHPUnit 11 use in Behat
This commit is contained in:
Joas Schilling 2025-12-15 10:01:28 +01:00 committed by GitHub
commit 82577dc459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
use Behat\Hook\AfterScenario;
use Behat\Hook\BeforeScenario;
use Behat\Hook\BeforeSuite;
use Behat\Step\Given;
use Behat\Step\Then;
use Behat\Step\When;
@ -208,6 +209,11 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
}
#[BeforeSuite]
public static function createPHPUnitConfiguration(): void {
(new \PHPUnit\TextUI\Configuration\Builder())->build([]);
}
#[BeforeScenario]
public function setUp(BeforeScenarioScope $scope): void {
self::$currentScenario = $scope->getFeature()->getTitle() . ':' . $scope->getScenario()->getLine() . ' - ' . $scope->getScenario()->getTitle();