Verified Commit 1e15ed9d authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3164686 by mondrake, longwave, ridhimaabrol24:...

Issue #3164686 by mondrake, longwave, ridhimaabrol24: WebAssert::addressEquals() and AssertLegacyTrait::assertUrl() fail to check the querystring
parent 2e80fc24
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
use Drupal\Tests\BrowserTestBase;

// cspell:ignore scriptalertxsssubjectscript

/**
 * Tests that the block configuration UI exists and stores data correctly.
 *
@@ -333,13 +335,12 @@ public function testBlockPlacementIndicator() {
    // block placement indicator. Click the first 'Place block' link to bring up
    // the list of blocks to place in the first available region.
    $this->clickLink('Place block');
    // Select the first available block.
    // Select the first available block, which is the 'test_xss_title' plugin,
    // with a default machine name 'scriptalertxsssubjectscript' that is used
    // for the 'block-placement' querystring parameter.
    $this->clickLink('Place block');
    $block = [];
    $block['id'] = strtolower($this->randomMachineName());
    $block['theme'] = 'classy';
    $this->submitForm([], 'Save block');
    $this->assertSession()->addressEquals('admin/structure/block/list/classy?block-placement=' . Html::getClass($block['id']));
    $this->assertSession()->addressEquals('admin/structure/block/list/classy?block-placement=scriptalertxsssubjectscript');

    // Removing a block will remove the block placement indicator.
    $this->clickLink('Remove');
+1 −1
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ public function testExternalDestinations() {
    ];
    $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.body/storage', [], 'Save field settings', $options);
    // The external redirect should not fire.
    $this->assertUrl('admin/structure/types/manage/article/fields/node.article.body/storage', $options);
    $this->assertUrl('admin/structure/types/manage/article/fields/node.article.body/storage?destinations%5B0%5D=http%3A//example.com');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertRaw('Attempt to update field <em class="placeholder">Body</em> failed: <em class="placeholder">The internal path component &#039;http://example.com&#039; is external. You are not allowed to specify an external URL together with internal:/.</em>.');
  }
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public function testForumIndexStatus() {
    // Create the forum topic, preselecting the forum ID via a URL parameter.
    $this->drupalGet("forum/$tid");
    $this->clickLink(t('Add new @node_type', ['@node_type' => 'Forum topic']));
    $this->assertUrl('node/add/forum', ['query' => ['forum_id' => $tid]]);
    $this->assertUrl("node/add/forum?forum_id=$tid");
    $this->drupalPostForm(NULL, $edit, t('Save'));

    // Check that the node exists in the database.
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ public function testLanguageSessionSwitchLinks() {
    // Click on the French link.
    $this->clickLink(t('French'));
    // There should be a query parameter to set the session language.
    $this->assertUrl('user/2', ['query' => ['language' => 'fr']]);
    $this->assertUrl('user/2?language=fr');
    // Click on the 'Home' Link.
    $this->clickLink(t('Home'));
    // There should be no query parameter.
+2 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ public function testConfirmForm() {
    // Test cancelling the form with a complex destination.
    $this->drupalGet('form-test/confirm-form-array-path');
    $this->clickLink(t('ConfirmFormArrayPathTestForm::getCancelText().'));
    $this->assertUrl('form-test/confirm-form', ['query' => ['destination' => 'admin/config']], "The form's complex cancel link was followed.");
    // Verify that the form's complex cancel link was followed.
    $this->assertUrl('form-test/confirm-form?destination=admin/config');
  }

  /**
Loading