You are here

public function ChangeMessageTypeTest::testChangeMessageType in Redirect 403 to User Login 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/ChangeMessageTypeTest.php \Drupal\Tests\r4032login\Functional\ChangeMessageTypeTest::testChangeMessageType()

Test type modification of the "User login access denied" message.

@dataProvider changeMessageTypeDataProvider

Parameters

string $optionValue: The option value to set.

string $selector: The selector we need to find on the page.

Throws

\Behat\Mink\Exception\ElementNotFoundException

File

tests/src/Functional/ChangeMessageTypeTest.php, line 36

Class

ChangeMessageTypeTest
Test that it is possible to change the type of the "Access denied" message.

Namespace

Drupal\Tests\r4032login\Functional

Code

public function testChangeMessageType($optionValue, $selector) {
  $config = $this
    ->config('r4032login.settings');
  $config
    ->set('access_denied_message_type', $optionValue);
  $config
    ->save();
  $this
    ->drupalGet('admin/config');
  $this
    ->assertSession()
    ->elementExists('css', $selector);
}