protected function PatchInfoTest::assertModuleExcluded in PatchInfo 8.2
Assert that a module is 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::assertModuleExcluded()
- PatchInfoTest::testModuleExclusion in tests/
src/ Functional/ PatchInfoTest.php - Tests exclusion of modules from update check.
File
- tests/
src/ Functional/ PatchInfoTest.php, line 607
Class
- PatchInfoTest
- Tests functionality of PatchInfo module.
Namespace
Drupal\Tests\patchinfo\FunctionalCode
protected function assertModuleExcluded($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
->assertTrue(isset($excluded_module[$index]), $message);
}