From b605206bd224996c637bbe473bd54d4ce92f8ef2 Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 14:07:30 +0100 Subject: [PATCH 1/7] Add support for php 8 versions --- .github/workflows/tests.yaml | 2 ++ composer.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dec4e6c..00a823a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,6 +16,8 @@ jobs: - 7.2 - 7.3 - 7.4 + - 8.0 + - 8.1 steps: - name: Checkout diff --git a/composer.json b/composer.json index f0d6ef8..723d61f 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "symfony/css-selector": "Dependency for symfony/dom-crawler" }, "require": { - "php": "~7.1" + "php": ">=7.1.3" }, "scripts": { "tests": "phpunit", From 129addf5780cf235eda85b4dfbf9519295829087 Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 14:10:58 +0100 Subject: [PATCH 2/7] Adding version compatibility for phpcs and phpunit --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 723d61f..cc593c4 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,8 @@ "require-dev": { "symfony/dom-crawler": "~3", "symfony/css-selector": "~3", - "internations/kodierungsregelwerksammlung": "^0.35.0", - "phpunit/phpunit": "~6", + "internations/kodierungsregelwerksammlung": "~0.35", + "phpunit/phpunit": "~7 || ~8 || ~9", "doctrine/annotations": "^1.2", "symfony/validator": "~3", "symfony/dependency-injection": "^4.0", From 12b7551234243ec7dd7f1311da273990d69360fd Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 14:42:53 +0100 Subject: [PATCH 3/7] Phpunit compatibility --- phpunit.xml.dist | 17 ----------------- .../Testing/DomCrawlerAssertionTrait.php | 10 +++++----- .../Tests/DomCrawlerAssertionTraitTest.php | 2 +- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c79125e..f4dda06 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,7 @@ convertErrorsToExceptions="true" convertWarningsToExceptions="true" convertNoticesToExceptions="true" - mapTestClassNameToCoveredClassName="true" bootstrap="vendor/autoload.php" - strict="true" verbose="true" colors="true" timeoutForLargeTests="100"> @@ -16,21 +14,6 @@ - - - - - - - - - vendor/ - tests/ - - - diff --git a/src/InterNations/Component/Testing/DomCrawlerAssertionTrait.php b/src/InterNations/Component/Testing/DomCrawlerAssertionTrait.php index f17dd8a..c818eca 100644 --- a/src/InterNations/Component/Testing/DomCrawlerAssertionTrait.php +++ b/src/InterNations/Component/Testing/DomCrawlerAssertionTrait.php @@ -38,7 +38,7 @@ protected static function assertHtmlSelectorContains( string $message = '' ): void { - self::assertContains($expected, (new Crawler($document))->filter($selector)->text(null, true), $message); + self::assertStringContainsString($expected, (new Crawler($document))->filter($selector)->text(null, true), $message); } protected static function assertNotHtmlSelectorContains( @@ -53,7 +53,7 @@ protected static function assertNotHtmlSelectorContains( } catch (InvalidArgumentException $e) { $value = ''; } - self::assertNotContains($expected, $value, $message); + self::assertNotContains($expected, [$value], $message); } protected static function assertHtmlSelectorAttribute( @@ -75,7 +75,7 @@ protected static function assertHtmlSelectorAttributeContains( string $message = '' ): void { - self::assertContains($expected, (new Crawler($document))->filter($selector)->attr($attribute), $message); + self::assertContains($expected, [(new Crawler($document))->filter($selector)->attr($attribute)], $message); } protected static function assertNotHtmlSelectorAttribute( @@ -126,7 +126,7 @@ protected static function assertXpathSelectorContains( string $message = '' ): void { - self::assertContains($expected, (new Crawler($document))->filterXPath($xpath)->text(null, true), $message); + self::assertStringContainsString($expected, (new Crawler($document))->filterXPath($xpath)->text(null, true), $message); } protected static function assertNotXpathSelectorContains( @@ -141,7 +141,7 @@ protected static function assertNotXpathSelectorContains( } catch (InvalidArgumentException $e) { $value = ''; } - self::assertNotContains($expected, $value, $message); + self::assertNotContains($expected, [$value], $message); } protected static function assertXpathSelectorAttribute( diff --git a/tests/InterNations/Component/Testing/Tests/DomCrawlerAssertionTraitTest.php b/tests/InterNations/Component/Testing/Tests/DomCrawlerAssertionTraitTest.php index 40cc169..cb18dec 100644 --- a/tests/InterNations/Component/Testing/Tests/DomCrawlerAssertionTraitTest.php +++ b/tests/InterNations/Component/Testing/Tests/DomCrawlerAssertionTraitTest.php @@ -10,7 +10,7 @@ class DomCrawlerAssertionTraitTest extends AbstractTestCase private $fixture; - public function setUp() + public function setUp(): void { $this->fixture = file_get_contents(__DIR__ . '/Fixtures/DomCrawlerFixture.html'); } From 092b905e416f7d81bcf4960b96d70219cfa02434 Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 19:30:37 +0100 Subject: [PATCH 4/7] Trying to update dom-crawler --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cc593c4..88db669 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } }, "require-dev": { - "symfony/dom-crawler": "~3", + "symfony/dom-crawler": "~5", "symfony/css-selector": "~3", "internations/kodierungsregelwerksammlung": "~0.35", "phpunit/phpunit": "~7 || ~8 || ~9", From 42f4fbfa461410b6a574e09f465abf0d447f9496 Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 19:33:24 +0100 Subject: [PATCH 5/7] Make it compatible with php 7.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 88db669..2436c1b 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } }, "require-dev": { - "symfony/dom-crawler": "~5", + "symfony/dom-crawler": "~4 || ~5", "symfony/css-selector": "~3", "internations/kodierungsregelwerksammlung": "~0.35", "phpunit/phpunit": "~7 || ~8 || ~9", From d6959910c7239e758ce6961ce5b466f324519485 Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 19:48:18 +0100 Subject: [PATCH 6/7] Update dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2436c1b..e3ae719 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,11 @@ "internations/kodierungsregelwerksammlung": "~0.35", "phpunit/phpunit": "~7 || ~8 || ~9", "doctrine/annotations": "^1.2", - "symfony/validator": "~3", + "symfony/validator": "^4.4 || ^5.0", "symfony/dependency-injection": "^4.0", "symfony/config": "^4.0", "symfony/http-kernel": "^4.0", - "symfony/framework-bundle": "^4.0" + "symfony/framework-bundle": "^4.4 || ^5.3" }, "suggest": { "symfony/dom-crawler": "Necessary to use DomCrawlerAssertionTrait", From 413f16923765fa0083839828bddeba01ffdfbefb Mon Sep 17 00:00:00 2001 From: Malvika Chauhan Date: Tue, 1 Mar 2022 19:59:00 +0100 Subject: [PATCH 7/7] Update all Symfony version to 4.x --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e3ae719..30bf51a 100644 --- a/composer.json +++ b/composer.json @@ -30,16 +30,16 @@ } }, "require-dev": { - "symfony/dom-crawler": "~4 || ~5", + "symfony/dom-crawler": "^4.0 || ^5.0", "symfony/css-selector": "~3", "internations/kodierungsregelwerksammlung": "~0.35", "phpunit/phpunit": "~7 || ~8 || ~9", "doctrine/annotations": "^1.2", - "symfony/validator": "^4.4 || ^5.0", + "symfony/validator": "^4.0 || ^5.0", "symfony/dependency-injection": "^4.0", "symfony/config": "^4.0", "symfony/http-kernel": "^4.0", - "symfony/framework-bundle": "^4.4 || ^5.3" + "symfony/framework-bundle": "^4.0 || ^5.0" }, "suggest": { "symfony/dom-crawler": "Necessary to use DomCrawlerAssertionTrait",