function ConfigEntityExampleTest::assertActionButton

Wrap an assertion for the action button.

Parameters

string $path: Drupal path to a page.

1 call to ConfigEntityExampleTest::assertActionButton()
ConfigEntityExampleTest::testConfigEntityExample in modules/config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php
Various functional test of the Config Entity Example module.

File

modules/config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php, line 169

Class

ConfigEntityExampleTest
Test the Config Entity Example module.

Namespace

Drupal\Tests\config_entity_example\Functional

Code

protected function assertActionButton($path) {
  $button_element = $this->xpath('//a[contains(@class, "button-action") and contains(@data-drupal-link-system-path, :path)]', [
    ':path' => $path,
  ]);
  $this->assertEquals(count($button_element), 1, 'Found action button for path: ' . $path);
}