$message=$assertion?newFormattableMarkup("@context display '@id' depends on @type '@key'.",$args):newFormattableMarkup("@context display '@id' do not depend on @type '@key'.",$args);
$display_id=$display->id();
$message=$assertion?"$context display '$display_id' depends on $type '$key'.":"$context display '$display_id' do not depend on $type '$key'.";
@@ -57,16 +57,16 @@ public function assertFileHooksCalled($expected) {
// Determine if there were any expected that were not called.
$uncalled=array_diff($expected,$actual);
if(count($uncalled)){
$this->assertTrue(FALSE,newFormattableMarkup('Expected hooks %expected to be called but %uncalled was not called.',['%expected'=>implode(', ',$expected),'%uncalled'=>implode(', ',$uncalled)]));
$this->assertTrue(FALSE,sprintf('Expected hooks %s to be called but %s was not called.',implode(', ',$expected),implode(', ',$uncalled)));
}
else{
$this->assertTrue(TRUE,newFormattableMarkup('All the expected hooks were called: %expected',['%expected'=>empty($expected)?'(none)':implode(', ',$expected)]));
$this->assertTrue(TRUE,sprintf('All the expected hooks were called: %s',empty($expected)?'(none)':implode(', ',$expected)));
}
// Determine if there were any unexpected calls.
$unexpected=array_diff($actual,$expected);
if(count($unexpected)){
$this->assertTrue(FALSE,newFormattableMarkup('Unexpected hooks were called: %unexpected.',['%unexpected'=>empty($unexpected)?'(none)':implode(', ',$unexpected)]));
$this->assertTrue(FALSE,sprintf('Unexpected hooks were called: %s.',empty($unexpected)?'(none)':implode(', ',$unexpected)));
}
else{
$this->assertTrue(TRUE,'No unexpected hooks were called.');
$this->assertEquals($expected_parent,$menu_link_plugin->getParent(),newFormattableMarkup('Menu link %id has parent of %parent, expected %expected_parent.',['%id'=>$id,'%parent'=>$menu_link_plugin->getParent(),'%expected_parent'=>$expected_parent]));
$link_parent=$menu_link_plugin->getParent();
$this->assertEquals($expected_parent,$link_parent,"Menu link $id has parent of $link_parent, expected $expected_parent.");