You are here

protected function PatchInfoTest::assertModuleNotExcluded in PatchInfo 8.2

Assert that a module is not listed as excluded above the update report.

Parameters

string $module_label: Module label as listed in update report.

int $index: Link position counting from zero.

string $message: (optional) A message to display with the assertion. Do not translate messages: use strtr() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

1 call to PatchInfoTest::assertModuleNotExcluded()
PatchInfoTest::testModuleExclusion in tests/src/Functional/PatchInfoTest.php
Tests exclusion of modules from update check.

File

tests/src/Functional/PatchInfoTest.php, line 639

Class

PatchInfoTest
Tests functionality of PatchInfo module.

Namespace

Drupal\Tests\patchinfo\Functional

Code

protected function assertModuleNotExcluded($module_label, $index = 0, $message = '') {

  // Get any div elements with class 'patchinfo-excluded-modules'.
  $xpath = '//div[@class="patchinfo-excluded-modules"]';

  // That contain an unordered list.
  $xpath .= '/ul';

  // With a list item containing the module label.
  $xpath .= '/li[normalize-space(text())=:module_label]';
  $excluded_module = $this
    ->xpath($xpath, [
    ':module_label' => $module_label,
  ]);
  return $this
    ->assertFalse(isset($excluded_module[$index]), $message);
}