public function ReferenceAccessTest::referenceAccessAssertMessage in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/tests/src/Kernel/ReferenceAccessTest.php \Drupal\Tests\bibcite_entity\Kernel\ReferenceAccessTest::referenceAccessAssertMessage()
Constructs an assert message to display which reference access was tested.
Parameters
string $operation: The operation to check access for.
bool $result: Whether access should be granted or not.
string|null $langcode: (optional) The language code indicating which translation of the reference to check. If NULL, the untranslated (fallback) access is checked.
Return value
string An assert message string which contains information in plain English about the reference access permission test that was performed.
2 calls to ReferenceAccessTest::referenceAccessAssertMessage()
- ReferenceAccessTest::assertReferenceAccess in modules/
bibcite_entity/ tests/ src/ Kernel/ ReferenceAccessTest.php - Asserts that reference access correctly grants or denies access.
- ReferenceAccessTest::assertReferenceCreateAccess in modules/
bibcite_entity/ tests/ src/ Kernel/ ReferenceAccessTest.php - Asserts that reference create access correctly grants or denies access.
File
- modules/
bibcite_entity/ tests/ src/ Kernel/ ReferenceAccessTest.php, line 312
Class
- ReferenceAccessTest
- Tests basic reference_access functionality.
Namespace
Drupal\Tests\bibcite_entity\KernelCode
public function referenceAccessAssertMessage($operation, $result, $langcode = NULL) {
return new FormattableMarkup('Reference access returns @result with operation %op, language code %langcode.', [
'@result' => $result ? 'true' : 'false',
'%op' => $operation,
'%langcode' => !empty($langcode) ? $langcode : 'empty',
]);
}