You are here

public function RabbitHoleBehaviorSettingsFormTestBase::testEntityFormSaveRedirect in Rabbit Hole 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php \Drupal\Tests\rabbit_hole\Functional\RabbitHoleBehaviorSettingsFormTestBase::testEntityFormSaveRedirect()

Test redirect after entity form save.

File

tests/src/Functional/RabbitHoleBehaviorSettingsFormTestBase.php, line 263

Class

RabbitHoleBehaviorSettingsFormTestBase
Base class for the Rabbit Hole form additions tests.

Namespace

Drupal\Tests\rabbit_hole\Functional

Code

public function testEntityFormSaveRedirect() {
  $override = BehaviorSettings::OVERRIDE_DISALLOW;
  $action = 'access_denied';
  $this
    ->createEntityBundleFormSubmit($action, $override);
  $this
    ->loadCreateEntityForm();
  $this
    ->assertNoRabbitHoleSettings();
  $this
    ->submitForm([], $this
    ->getEntityFormSubmit());

  // Make sure the editor didn't hit error page after the form save in case
  // there is no Rabbit Hole actions available.
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}