You are here

private function UiTest::assertFrontEndEnvironmentDeploymentFormFunctionality in Build Hooks 3.x

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

Tests deployment form functionality.

Parameters

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

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

File

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

Class

UiTest
Defines a class for testing build hooks UI.

Namespace

Drupal\Tests\build_hooks\Functional

Code

private function assertFrontEndEnvironmentDeploymentFormFunctionality(FrontendEnvironmentInterface $environment) {
  $label = $this
    ->randomMachineName();
  $entity = EntityTest::create([
    'name' => $label,
  ]);
  $entity
    ->save();
  $this
    ->assertToolbarIntegration($environment, 1);
  $label2 = $this
    ->randomMachineName();
  $entity2 = EntityTest::create([
    'name' => $label2,
  ]);
  $entity2
    ->save();
  $entity2
    ->delete();
  $this
    ->drupalGet(Url::fromRoute('build_hooks.deployment_form', [
    'frontend_environment' => $environment
      ->id(),
  ]));
  $assert = $this
    ->assertSession();
  $assert
    ->pageTextContains($environment
    ->label() . ' environment deployment');
  $assert
    ->linkExists('http://example.com/' . $environment
    ->id());
  $assert
    ->pageTextContains('Changelog');
  $assert
    ->linkExists($label);
  $assert
    ->pageTextContains('Deployment contents');
  $assert
    ->pageTextContains('Deleted items');
  $assert
    ->pageTextContains(sprintf('%s (Test entity)', $label2));
  $assert
    ->elementExists('css', 'h3:contains("Hi there")');
}