You are here

public function ChangeMessageTypeTest::testChangeMessageType in Redirect 403 to User Login 8

Same name and namespace in other branches
  1. 2.x 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 31

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);
}