From 3ba83e7da2dfd5e4bbc2f5df26b866c20df944eb Mon Sep 17 00:00:00 2001 From: Christian Sciberras Date: Mon, 9 Dec 2024 21:45:20 +0100 Subject: [PATCH] Upgrade phpunit; rename xml file; fix tests --- .gitattributes | 2 +- .gitignore | 2 ++ composer.json | 2 +- phpunit.dist.xml | 31 +++++++++++++++++++ phpunit.xml.dist | 25 --------------- .../{FilterTest.php => FilterTestCase.php} | 2 +- tests/Behat/Gherkin/Filter/LineFilterTest.php | 2 +- .../Gherkin/Filter/LineRangeFilterTest.php | 2 +- .../Gherkin/Filter/NarrativeFilterTest.php | 2 +- .../Behat/Gherkin/Filter/PathsFilterTest.php | 4 +-- tests/Behat/Gherkin/Filter/RoleFilterTest.php | 4 +-- .../Gherkin/Keywords/ArrayKeywordsTest.php | 2 +- .../Keywords/CachedArrayKeywordsTest.php | 2 +- .../Gherkin/Keywords/CucumberKeywordsTest.php | 2 +- ...{KeywordsTest.php => KeywordsTestCase.php} | 2 +- 15 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 phpunit.dist.xml delete mode 100644 phpunit.xml.dist rename tests/Behat/Gherkin/Filter/{FilterTest.php => FilterTestCase.php} (97%) rename tests/Behat/Gherkin/Keywords/{KeywordsTest.php => KeywordsTestCase.php} (99%) diff --git a/.gitattributes b/.gitattributes index 76bd9afa..86c5cffe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,4 @@ /.gitignore export-ignore /package.xml.tpl export-ignore /phpdoc.ini.dist export-ignore -/phpunit.xml.dist export-ignore +/phpunit.dist.xml export-ignore diff --git a/.gitignore b/.gitignore index de51ec00..0499d593 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ vendor composer.phar composer.lock +.phpunit.cache .phpunit.result.cache +phpunit.xml diff --git a/composer.json b/composer.json index b4052cd9..f43ee612 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require-dev": { "symfony/yaml": "^5.4 || ^6.4 || ^7.0", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^10.5", "cucumber/cucumber": "dev-gherkin-24.1.0" }, diff --git a/phpunit.dist.xml b/phpunit.dist.xml new file mode 100644 index 00000000..3cff3887 --- /dev/null +++ b/phpunit.dist.xml @@ -0,0 +1,31 @@ + + + + + ./tests/Behat/Gherkin/ + + + + + ./src/Behat/Gherkin/ + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index fbe1da6d..00000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - ./tests/Behat/Gherkin/ - - - - - - ./src/Behat/Gherkin/ - - - diff --git a/tests/Behat/Gherkin/Filter/FilterTest.php b/tests/Behat/Gherkin/Filter/FilterTestCase.php similarity index 97% rename from tests/Behat/Gherkin/Filter/FilterTest.php rename to tests/Behat/Gherkin/Filter/FilterTestCase.php index 68662c19..fb056b48 100644 --- a/tests/Behat/Gherkin/Filter/FilterTest.php +++ b/tests/Behat/Gherkin/Filter/FilterTestCase.php @@ -7,7 +7,7 @@ use Behat\Gherkin\Parser; use PHPUnit\Framework\TestCase; -abstract class FilterTest extends TestCase +abstract class FilterTestCase extends TestCase { protected function getParser() { diff --git a/tests/Behat/Gherkin/Filter/LineFilterTest.php b/tests/Behat/Gherkin/Filter/LineFilterTest.php index 5e8be7d3..e621e8e5 100644 --- a/tests/Behat/Gherkin/Filter/LineFilterTest.php +++ b/tests/Behat/Gherkin/Filter/LineFilterTest.php @@ -8,7 +8,7 @@ use Behat\Gherkin\Node\OutlineNode; use Behat\Gherkin\Node\ScenarioNode; -class LineFilterTest extends FilterTest +class LineFilterTest extends FilterTestCase { public function testIsFeatureMatchFilter() { diff --git a/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php b/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php index a27c9a71..8609bee0 100644 --- a/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php +++ b/tests/Behat/Gherkin/Filter/LineRangeFilterTest.php @@ -8,7 +8,7 @@ use Behat\Gherkin\Node\OutlineNode; use Behat\Gherkin\Node\ScenarioNode; -class LineRangeFilterTest extends FilterTest +class LineRangeFilterTest extends FilterTestCase { public function featureLineRangeProvider() { diff --git a/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php b/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php index 6a50e1eb..dc2ebe8d 100644 --- a/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php +++ b/tests/Behat/Gherkin/Filter/NarrativeFilterTest.php @@ -5,7 +5,7 @@ use Behat\Gherkin\Filter\NarrativeFilter; use Behat\Gherkin\Node\FeatureNode; -class NarrativeFilterTest extends FilterTest +class NarrativeFilterTest extends FilterTestCase { public function testIsFeatureMatchFilter() { diff --git a/tests/Behat/Gherkin/Filter/PathsFilterTest.php b/tests/Behat/Gherkin/Filter/PathsFilterTest.php index ff064d0c..5d49ca0f 100644 --- a/tests/Behat/Gherkin/Filter/PathsFilterTest.php +++ b/tests/Behat/Gherkin/Filter/PathsFilterTest.php @@ -5,7 +5,7 @@ use Behat\Gherkin\Filter\PathsFilter; use Behat\Gherkin\Node\FeatureNode; -class PathsFilterTest extends FilterTest +class PathsFilterTest extends FilterTestCase { public function testIsFeatureMatchFilter() { @@ -44,7 +44,7 @@ public function testItDoesNotMatchPartialPaths() $filter = new PathsFilter(array($fixtures . 'full_path')); $this->assertTrue($filter->isFeatureMatch($feature)); - + $filter = new PathsFilter(array($fixtures . 'ful._path')); // Don't accept regexp $this->assertFalse($filter->isFeatureMatch($feature)); } diff --git a/tests/Behat/Gherkin/Filter/RoleFilterTest.php b/tests/Behat/Gherkin/Filter/RoleFilterTest.php index ead43643..72c3632b 100644 --- a/tests/Behat/Gherkin/Filter/RoleFilterTest.php +++ b/tests/Behat/Gherkin/Filter/RoleFilterTest.php @@ -5,7 +5,7 @@ use Behat\Gherkin\Filter\RoleFilter; use Behat\Gherkin\Node\FeatureNode; -class RoleFilterTest extends FilterTest +class RoleFilterTest extends FilterTestCase { public function testIsFeatureMatchFilter() { @@ -62,7 +62,7 @@ public function testFeatureRolePrefixedWithAn() $filter = new RoleFilter('*user'); $this->assertTrue($filter->isFeatureMatch($feature)); - + $filter = new RoleFilter('[\w\s]+user'); $this->assertFalse($filter->isFeatureMatch($feature)); diff --git a/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php b/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php index e6c18dc9..7a48bbef 100644 --- a/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php +++ b/tests/Behat/Gherkin/Keywords/ArrayKeywordsTest.php @@ -5,7 +5,7 @@ use Behat\Gherkin\Keywords\ArrayKeywords; use Behat\Gherkin\Node\StepNode; -class ArrayKeywordsTest extends KeywordsTest +class ArrayKeywordsTest extends KeywordsTestCase { protected function getKeywords() { diff --git a/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php b/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php index bf10cb39..e64ed9f5 100644 --- a/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php +++ b/tests/Behat/Gherkin/Keywords/CachedArrayKeywordsTest.php @@ -5,7 +5,7 @@ use Behat\Gherkin\Keywords\CachedArrayKeywords; use Behat\Gherkin\Node\StepNode; -class CachedArrayKeywordsTest extends KeywordsTest +class CachedArrayKeywordsTest extends KeywordsTestCase { protected function getKeywords() { diff --git a/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php b/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php index b2b0783f..810471e4 100644 --- a/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php +++ b/tests/Behat/Gherkin/Keywords/CucumberKeywordsTest.php @@ -6,7 +6,7 @@ use Behat\Gherkin\Node\StepNode; use Symfony\Component\Yaml\Yaml; -class CucumberKeywordsTest extends KeywordsTest +class CucumberKeywordsTest extends KeywordsTestCase { protected function getKeywords() { diff --git a/tests/Behat/Gherkin/Keywords/KeywordsTest.php b/tests/Behat/Gherkin/Keywords/KeywordsTestCase.php similarity index 99% rename from tests/Behat/Gherkin/Keywords/KeywordsTest.php rename to tests/Behat/Gherkin/Keywords/KeywordsTestCase.php index a3094f48..b26fe2ec 100644 --- a/tests/Behat/Gherkin/Keywords/KeywordsTest.php +++ b/tests/Behat/Gherkin/Keywords/KeywordsTestCase.php @@ -12,7 +12,7 @@ use Behat\Gherkin\Parser; use PHPUnit\Framework\TestCase; -abstract class KeywordsTest extends TestCase +abstract class KeywordsTestCase extends TestCase { abstract protected function getKeywords(); abstract protected function getKeywordsArray();