You are here

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

Tests inactive environment toolbar integration.

Parameters

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

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

File

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

Class

UiTest
Defines a class for testing build hooks UI.

Namespace

Drupal\Tests\build_hooks\Functional

Code

private function assertInactiveEnvironmentToolbarIntegration(FrontendEnvironmentInterface $environment) {
  $environment
    ->set('status', TRUE);
  $environment
    ->save();
  $this
    ->drupalGet(Url::fromRoute('<front>'));
  $this
    ->assertSession()
    ->linkExists(sprintf('%s (2 changes)', $environment
    ->label()));
  $environment
    ->set('status', FALSE);
  $environment
    ->save();
  $this
    ->drupalGet(Url::fromRoute('<front>'));
  $this
    ->assertSession()
    ->linkNotExists(sprintf('%s (2 changes)', $environment
    ->label()));
  $environment
    ->set('status', TRUE);
  $environment
    ->save();
  $this
    ->drupalGet(Url::fromRoute('<front>'));
  $this
    ->assertSession()
    ->linkExists(sprintf('%s (2 changes)', $environment
    ->label()));
}