Verified Commit f9d3970b authored by Dave Long's avatar Dave Long
Browse files

Issue #3421258 by mstrelan, acbramley: Fix strict type errors in WebAssert calls

(cherry picked from commit c4e7dd71)
parent e8b89f34
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ public function testContentTranslationNodeForm() {
    $french = \Drupal::languageManager()->getLanguage('fr');

    $this->drupalGet($latest_version_path);
    $this->assertSession()->statusCodeEquals('403');
    $this->assertSession()->statusCodeEquals(403);
    $this->assertSession()->elementNotExists('xpath', '//ul[@class="entity-moderation-form"]');

    // Add french translation (revision 2).
@@ -326,7 +326,7 @@ public function testContentTranslationNodeForm() {
    ], 'Save (this translation)');

    $this->drupalGet($latest_version_path, ['language' => $french]);
    $this->assertSession()->statusCodeEquals('403');
    $this->assertSession()->statusCodeEquals(403);
    $this->assertSession()->elementNotExists('xpath', '//ul[@class="entity-moderation-form"]');

    // Add french pending revision (revision 3).
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ protected function assertFilterStates(array $states, bool $check_size = FALSE):
    // Check that the size of the select element does not exceed 8 options.
    if ($check_size) {
      $this->assertGreaterThan(8, count($states));
      $assert_session->elementAttributeContains('css', '#edit-default-revision-state', 'size', 8);
      $assert_session->elementAttributeContains('css', '#edit-default-revision-state', 'size', '8');
    }

    // Check that an option exists for each of the expected states.
+4 −4
Original line number Diff line number Diff line
@@ -160,22 +160,22 @@ public function testExposedGroupedFilters() {
    $this->drupalGet($path);

    // Filter the Preview by 'empty'.
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption(1);
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption('1');
    $this->getSession()->getPage()->pressButton('Apply');
    $this->assertIds([4]);

    // Filter the Preview by 'not empty'.
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption(2);
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption('2');
    $this->getSession()->getPage()->pressButton('Apply');
    $this->assertIds([1, 2, 3]);

    // Filter the Preview by 'less than'.
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption(3);
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption('3');
    $this->getSession()->getPage()->pressButton('Apply');
    $this->assertIds([2, 3]);

    // Filter the Preview by 'between'.
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption(4);
    $this->getSession()->getPage()->findField($this->fieldName . '_value')->selectOption('4');
    $this->getSession()->getPage()->pressButton('Apply');
    $this->assertIds([2]);
  }
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ protected function assertTwigTransTags(): void {
    // Makes sure https://www.drupal.org/node/2489024 doesn't happen without
    // twig debug.
    // Ensure that running php code inside a Twig trans is not possible.
    $this->assertSession()->pageTextNotContains(pi());
    $this->assertSession()->pageTextNotContains((string) pi());
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ protected function setUp(): void {
  public function testTelephoneWidget() {
    $this->drupalGet('node/add/article');
    $this->assertSession()->fieldValueEquals("field_telephone[0][value]", '');
    $this->assertSession()->elementAttributeContains('css', 'input[name="field_telephone[0][value]"]', 'maxlength', TelephoneItem::MAX_LENGTH);
    $this->assertSession()->elementAttributeContains('css', 'input[name="field_telephone[0][value]"]', 'maxlength', (string) TelephoneItem::MAX_LENGTH);
    $this->assertSession()->responseContains('placeholder="123-456-7890"');
  }

Loading