You are here

private function UiTest::assertToolbarIntegration 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::assertToolbarIntegration()

Tests toolbar integration.

Parameters

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

int $expected_count: Expected count.

2 calls to UiTest::assertToolbarIntegration()
UiTest::assertFrontEndEnvironmentDeploymentFormFunctionality in tests/src/Functional/UiTest.php
Tests deployment form functionality.
UiTest::testBuildHooksUi in tests/src/Functional/UiTest.php
Test build hooks UI.

File

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

Class

UiTest
Defines a class for testing build hooks UI.

Namespace

Drupal\Tests\build_hooks\Functional

Code

private function assertToolbarIntegration(FrontendEnvironmentInterface $environment, int $expected_count) {
  $this
    ->drupalGet(Url::fromRoute('<front>'));
  if ($expected_count > 1) {
    $this
      ->assertSession()
      ->linkExists(sprintf('%s (2 changes)', $environment
      ->label()));
  }
  else {
    $this
      ->assertSession()
      ->linkExists(sprintf('%s (1 change)', $environment
      ->label()));
  }
}