mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #65409
[Bug 1964834] [NEW] behat on php 7.2 vs 7.4
Public bug reported:
In external/composer.json we have behat/mink nailed to a specific
version. Moving this version will be time consuming as we quickly enter
what I call 'dependency hell'.
There are some elements that do not play well with php 7.4, e.g.
implode() is now no longer flexible on the order of its attributes and
throws an error.
Edits to the files in external/vendor will be overwritten on the next
'make initcomposer'.
To resolve this I have the following suggestion;
diff --git a/external/composer.json b/external/composer.json
index 2cea1b26cb..384ed0234d 100644
--- a/external/composer.json
+++ b/external/composer.json
@@ -11,12 +11,21 @@
"guzzlehttp/guzzle": "^6.3.0",
"phpunit/phpunit": "^8",
"behat/mink-browserkit-driver": "1.3.3",
- "symfony/css-selector": "3.4.38"
+ "symfony/css-selector": "3.4.38",
+ "cweagans/composer-patches": "^1.7"
},
"autoload": {
"psr-0": {
"MaharaExtension": "../htdocs/testing/frameworks/behat/extension/"
}
+ },
+ "config": {
+ "allow-plugins": {
+ "cweagans/composer-patches": true
+ }
+ },
+ "extra": {
+ "patches-file": "composer.patches.json"
}
}
This will pull in cweagans/composer-patches, enable it, and set up
composer.patches.json as the file that manages our tweaks to the stuff
we're checking out.
external/composer.patches.json:
{
"patches": {
"behat/mink": {
"Fix implode()": "escaper.patch"
}
}
}
This gives us a single patch file that we will use.
external/escaper.patch:
--- a/vendor/behat/mink/src/Selector/Xpath/Escaper.php 2022-03-15 10:30:18.902551052 +1300
+++ b/vendor/behat/mink/src/Selector/Xpath/Escaper.php 2022-03-15 10:31:41.315406073 +1300
@@ -47,6 +47,6 @@
}
}
- return sprintf('concat(%s)', implode($parts, ','));
+ return sprintf('concat(%s)', implode(',', $parts));
}
}
This fixes the implode() statement that causes issues on php 7.4.
** Affects: mahara
Importance: Undecided
Status: New
** Tags: behat-dev bite-sized
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1964834
Title:
behat on php 7.2 vs 7.4
Status in Mahara:
New
Bug description:
In external/composer.json we have behat/mink nailed to a specific
version. Moving this version will be time consuming as we quickly
enter what I call 'dependency hell'.
There are some elements that do not play well with php 7.4, e.g.
implode() is now no longer flexible on the order of its attributes and
throws an error.
Edits to the files in external/vendor will be overwritten on the next
'make initcomposer'.
To resolve this I have the following suggestion;
diff --git a/external/composer.json b/external/composer.json
index 2cea1b26cb..384ed0234d 100644
--- a/external/composer.json
+++ b/external/composer.json
@@ -11,12 +11,21 @@
"guzzlehttp/guzzle": "^6.3.0",
"phpunit/phpunit": "^8",
"behat/mink-browserkit-driver": "1.3.3",
- "symfony/css-selector": "3.4.38"
+ "symfony/css-selector": "3.4.38",
+ "cweagans/composer-patches": "^1.7"
},
"autoload": {
"psr-0": {
"MaharaExtension": "../htdocs/testing/frameworks/behat/extension/"
}
+ },
+ "config": {
+ "allow-plugins": {
+ "cweagans/composer-patches": true
+ }
+ },
+ "extra": {
+ "patches-file": "composer.patches.json"
}
}
This will pull in cweagans/composer-patches, enable it, and set up
composer.patches.json as the file that manages our tweaks to the stuff
we're checking out.
external/composer.patches.json:
{
"patches": {
"behat/mink": {
"Fix implode()": "escaper.patch"
}
}
}
This gives us a single patch file that we will use.
external/escaper.patch:
--- a/vendor/behat/mink/src/Selector/Xpath/Escaper.php 2022-03-15 10:30:18.902551052 +1300
+++ b/vendor/behat/mink/src/Selector/Xpath/Escaper.php 2022-03-15 10:31:41.315406073 +1300
@@ -47,6 +47,6 @@
}
}
- return sprintf('concat(%s)', implode($parts, ','));
+ return sprintf('concat(%s)', implode(',', $parts));
}
}
This fixes the implode() statement that causes issues on php 7.4.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1964834/+subscriptions
Follow ups
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Gold, 2022-04-27
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Dianne Tennent, 2022-04-27
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Doris Tam, 2022-04-27
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Robert Lyon, 2022-04-27
-
[Bug 1964834] A change has been merged
From: Mahara Bot, 2022-03-23
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Robert Lyon, 2022-03-23
-
[Bug 1964834] A change has been merged
From: Mahara Bot, 2022-03-23
-
[Bug 1964834] A change has been merged
From: Mahara Bot, 2022-03-23
-
[Bug 1964834] A patch has been submitted for review
From: Mahara Bot, 2022-03-22
-
[Bug 1964834] A patch has been submitted for review
From: Mahara Bot, 2022-03-22
-
[Bug 1964834] A patch has been submitted for review
From: Mahara Bot, 2022-03-22
-
[Bug 1964834] A change has been merged
From: Mahara Bot, 2022-03-22
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Robert Lyon, 2022-03-22
-
[Bug 1964834] A patch has been submitted for review
From: Mahara Bot, 2022-03-21
-
[Bug 1964834] Re: behat on php 7.2 vs 7.4
From: Kristina Hoeppner, 2022-03-21