You are here

private function NavigationalStructureTest::assertTitleEquals in Entity Construction Kit (ECK) 8

Asserts that the title of a page contains a given value.

Parameters

string $expectedTitle: The expected title.

1 call to NavigationalStructureTest::assertTitleEquals()
NavigationalStructureTest::assertCorrectPageOnRoute in tests/src/Functional/NavigationalStructureTest.php
Asserts that the page on a given route contains all the elements we expect.

File

tests/src/Functional/NavigationalStructureTest.php, line 134

Class

NavigationalStructureTest
Test Entity Construction Kit's navigational structure.

Namespace

Drupal\Tests\eck\Functional

Code

private function assertTitleEquals($expectedTitle) {
  $titleElement = $this
    ->getSession()
    ->getPage()
    ->find('css', '.page-title');
  $actualTitle = $titleElement instanceof NodeElement ? $titleElement
    ->getText() : '';
  $this
    ->assertEquals($expectedTitle, $actualTitle);
}