Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
In PHPUnit 6 \PHPUnit_Util_XML
no longer has the cssSelect()
. We are trying to update to PHPUnit 6 so that we can test on PHP 7.2 - see #2927806: Use PHPUnit 6 for testing when PHP version >= 7.2. Therefore we need to remove the usage from \Drupal\tour\Tests\TourTestBase
. Unfortunately this is a legacy test class and it has no usages.
As part of the necessary things to enable PHP7.2 testing this is critical.
Proposed resolution
Replace \PHPUnit_Util_XML::cssSelect()
with xpath
and add a test so we can prove we've not broken it.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#8 | 2932044-8.patch | 3.27 KB | alexpott |
#8 | 3-8-interdiff.txt | 588 bytes | alexpott |
#3 | 2932044-3.patch | 3.44 KB | alexpott |
#3 | 2-3-interdiff.txt | 455 bytes | alexpott |
#3 | 2932044-3.test-only.patch | 2.24 KB | alexpott |
|
Comments
Comment #2
alexpottHere's a patch. The test-only patch (unlike most) should be green. Attaching it to show the assumptions the TestBase class makes are not changed by the change to the class.
Comment #3
alexpottOops missed the @group.
Comment #4
martin107 CreditAttribution: martin107 as a volunteer commentedI have looked over this .. all seems correct and well reasoned.
I will lurk on this issue and come back when tests are passing to RTBC this...
I can see the smallest of small nits
+ * @code
+ * protected $tips = array(
+ * '/foo/bar' => array(
+ * 'data-id' => 'foo',
+ * 'data-class' => 'bar',
+ * ),
+ * );
+ * @endcode
The example code contains examples of array() when [] is prefered.
Comment #8
alexpott@martin107 this is a cut-and-paste job from \Drupal\Tests\tour\Functional\TourTestBasic - and the code snippet there is incorrect - but the class we're really aping is \Drupal\Tests\tour\Functional\TourTest so I've just copied the docs from there. Bear in mind that this is totally deprecated code and only exists to test the deprecated TourTestBase class so it definitely has a finite shelf life and also this test is not an extension point so the docs are pointless.
Comment #10
alexpottComment #11
martin107 CreditAttribution: martin107 as a volunteer commentedI think this is a good change....
Comment #13
catchCommitted 93b9f58 and pushed to 8.5.x. Thanks!