From 08c40c393550e050dad69a7d5ec7d5295322b2bd Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 30 Oct 2024 13:42:47 +0000 Subject: [PATCH] Fixes #188. @Transform PHPdoc should be allowed in Behat files --- moodle/Tests/Util/DocblocksTest.php | 4 ++-- moodle/Util/Docblocks.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moodle/Tests/Util/DocblocksTest.php b/moodle/Tests/Util/DocblocksTest.php index 5bcc586..20ae548 100644 --- a/moodle/Tests/Util/DocblocksTest.php +++ b/moodle/Tests/Util/DocblocksTest.php @@ -268,7 +268,7 @@ class behat_example { * @Given * @When * @Then - * @Given + * @Transform */ function exampleFunction(string $param): void {} }', @@ -288,7 +288,7 @@ class test_behat { * @Given * @When * @Then - * @Given + * @Transform */ function exampleFunction(string $param): void {} }', diff --git a/moodle/Util/Docblocks.php b/moodle/Util/Docblocks.php index a67b5d2..a467539 100644 --- a/moodle/Util/Docblocks.php +++ b/moodle/Util/Docblocks.php @@ -43,6 +43,7 @@ abstract class Docblocks 'AfterFeature' => true, 'AfterScenario' => true, 'AfterStep' => true, + 'Transform' => true, // PHPUnit tags. 'codeCoverageIgnore' => true, @@ -130,6 +131,7 @@ abstract class Docblocks 'AfterFeature' => ['#.*/tests/behat/.*#'], 'AfterScenario' => ['#.*/tests/behat/.*#'], 'AfterStep' => ['#.*/tests/behat/.*#'], + 'Transform' => ['#.*/tests/behat/.*#'], 'covers' => ['#.*/tests/.*_test.php#'], 'coversDefaultClass' => ['#.*/tests/.*_test.php#'],