You are here

protected function ConfigEntityExampleTest::assertActionButton in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 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 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 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);
}