You are here

private function UiTest::assertThatAdminCanDeleteFrontEndEnvironment in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Functional/UiTest.php \Drupal\Tests\build_hooks\Functional\UiTest::assertThatAdminCanDeleteFrontEndEnvironment()

Tests admin can delete environments.

Parameters

\Drupal\build_hooks\Entity\FrontendEnvironmentInterface $environment: Environment.

1 call to UiTest::assertThatAdminCanDeleteFrontEndEnvironment()
UiTest::testBuildHooksUi in tests/src/Functional/UiTest.php
Test build hooks UI.

File

tests/src/Functional/UiTest.php, line 258

Class

UiTest
Defines a class for testing build hooks UI.

Namespace

Drupal\Tests\build_hooks\Functional

Code

private function assertThatAdminCanDeleteFrontEndEnvironment(FrontendEnvironmentInterface $environment) {
  $this
    ->drupalGet($environment
    ->toUrl('delete-form'));
  $assert = $this
    ->assertSession();
  $assert
    ->statusCodeEquals(200);
  $assert
    ->pageTextContains(sprintf('Are you sure you want to delete %s', $environment
    ->label()));
  $this
    ->submitForm([], 'Delete');
  $assert
    ->pageTextContains(sprintf('The frontend environment %s was deleted', $environment
    ->label()));
}