Commit 99d51a76 authored by Vishal Khode's avatar Vishal Khode
Browse files

Issue #3449074 by vishalkhode: Enable & fix failing PHPUnit tests for Drupal 9

parent 6f088e67
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -15,3 +15,7 @@ variables:
  OPT_IN_TEST_PREVIOUS_MINOR: 1
  OPT_IN_TEST_NEXT_MINOR: 1
  OPT_IN_TEST_NEXT_MAJOR: 1

  # Use PHP 8.1 instead of 7.4 for Previous Major Drupal Core.
  CORE_PREVIOUS_PHP_MIN: 8.1
  OPT_IN_TEST_PREVIOUS_MAJOR: 1
+3 −3
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ class PasswordResetBehaviorsTest extends BrowserTestBase {
    // User should be redirected to the user entity edit page after login.
    $this->drupalGet('user/login');
    $this->submitForm(['name' => 'testuser1', 'pass' => 'pass'], 'Log in');
    $this->assertSession()->addressEquals($user2->toUrl('edit-form'));
    $this->assertSession()->addressEquals($user2->toUrl('edit-form')->setAbsolute()->toString());
    $this->drupalLogout();

    // Create a new node type.
@@ -161,7 +161,7 @@ class PasswordResetBehaviorsTest extends BrowserTestBase {
    // Verify if user tries to go to node, they are forced back.
    $this->drupalGet('user/login');
    $this->submitForm(['name' => 'testuser1', 'pass' => 'pass'], 'Log in');
    $this->drupalGet($node->toUrl()->toString());
    $this->drupalGet('node/' . $node->id());
    $this->assertSession()->addressEquals($user2->toUrl('edit-form')->setAbsolute()->toString());

    // Change password.
@@ -177,7 +177,7 @@ class PasswordResetBehaviorsTest extends BrowserTestBase {
    self::assertEquals($user_instance->get('field_password_expiration')[0]->value, '0', 'Password expiration field should be empty after changing password');

    // Verify if user tries to go to node, they are allowed.
    $this->drupalGet($node->toUrl()->toString());
    $this->drupalGet('node/' . $node->id());
    $this->assertSession()->addressEquals($node->toUrl()->setAbsolute(TRUE)->toString());

    // Test submitting a node form while expired.