You are here

protected function ConfigEntityExampleTest::assertActionButton in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php \Drupal\Tests\config_entity_example\Functional\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 config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php
Various functional test of the Config Entity Example module.

File

config_entity_example/tests/src/Functional/ConfigEntityExampleTest.php, line 199

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
    ->assertEqual(count($button_element), 1, 'Found action button for path: ' . $path);
}