From 1c27344c647b15f6bb4df506c301dc2f1ea2e274 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 11 Dec 2024 18:11:40 +0100 Subject: [PATCH] use stubs for Then and When --- .../Fixture/Behat/with_next_line.php.inc | 30 +++++++++++++++++++ .../Behat/with_value_edge_cases.php.inc | 29 ++++++++++++++++++ .../Fixture/with_value_as_argument.php.inc | 10 +++---- .../Source/Attribute/Behat/When.php | 9 ------ .../config/configured_rule.php | 6 ++-- stubs/Behat/Step/Then.php | 12 ++++++++ stubs/Behat/Step/When.php | 12 ++++++++ 7 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_next_line.php.inc create mode 100644 rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_value_edge_cases.php.inc delete mode 100644 rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Attribute/Behat/When.php create mode 100644 stubs/Behat/Step/Then.php create mode 100644 stubs/Behat/Step/When.php diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_next_line.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_next_line.php.inc new file mode 100644 index 00000000000..68959e0125e --- /dev/null +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_next_line.php.inc @@ -0,0 +1,30 @@ + +----- + diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_value_edge_cases.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_value_edge_cases.php.inc new file mode 100644 index 00000000000..44a811e4935 --- /dev/null +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/Behat/with_value_edge_cases.php.inc @@ -0,0 +1,29 @@ + +----- + diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/with_value_as_argument.php.inc b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/with_value_as_argument.php.inc index 16c10051635..d6350a0f0d1 100644 --- a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/with_value_as_argument.php.inc +++ b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/with_value_as_argument.php.inc @@ -24,11 +24,11 @@ namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture; final class WithValueAsArgument { - #[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('this is a simple annotation with a value')] - #[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When] - #[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('"this value is within quotes"')] - #[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When('this value has a \' character')] - #[\Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\Attribute\Behat\When(key: 'value')] // this annotation has parameters so won't use this option + #[\Behat\Step\When('this is a simple annotation with a value')] + #[\Behat\Step\When] + #[\Behat\Step\When('"this value is within quotes"')] + #[\Behat\Step\When('this value has a \' character')] + #[\Behat\Step\When(key: 'value')] // this annotation has parameters so won't use this option public function someStep(): void { } diff --git a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Attribute/Behat/When.php b/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Attribute/Behat/When.php deleted file mode 100644 index 512f0aab72e..00000000000 --- a/rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Source/Attribute/Behat/When.php +++ /dev/null @@ -1,9 +0,0 @@ -