- πΊπΈUnited States smustgrave
Even though I submitted the last patch I only changed a space error. So this review is of #20 really
Change record looks good. The example is great addition!
Also like the test coverage as it shows an example of altering it on a live instance.
I think this is good to move on for core committer review.
The last submitted patch, 26: 3134618-26-tests-only.patch, failed testing. View results β
- Status changed to Fixed
over 1 year ago 9:45am 22 February 2023 - π¬π§United Kingdom alexpott πͺπΊπ
Committed 13fb795 and pushed to 10.1.x. Thanks!
diff --git a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php index 679a6620013..5838a06e9ba 100644 --- a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php +++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php @@ -651,8 +651,11 @@ public function testOptionsListAlter() { // Display form: check that _none options are present. $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit'); - $this->assertNotEmpty($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', [':id' => 'edit-card-1', ':label' => '- None -']), 'A test select has a "None" choice with default label.'); - $this->assertNotEmpty($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', [':id' => 'edit-card-4', ':label' => '- Please select something -']), 'A test select has a "None" choice with altered label.'); + $xpath = '//select[@id=:id]//option[@value="_none" and text()=:label]'; + $xpath_args = [':id' => 'edit-card-1', ':label' => '- None -']; + $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery($xpath, $xpath_args)); + $xpath_args = [':id' => 'edit-card-4', ':label' => '- Please select something -']; + $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery($xpath, $xpath_args)); // Display form: check that options are displayed correctly. $this->assertSession()->optionExists('card_1', 0);
Given we're asserting that an element exists let's use the correct assertion - you get better and more consistent error messages. Fixed on commit.
-
alexpott β
committed defcb862 on 10.1.x
Issue #3134618 by geek-merlin, smustgrave, Matroskeen, Kristen Pol,...
-
alexpott β
committed defcb862 on 10.1.x
Automatically closed - issue fixed for 2 weeks with no activity.