Commit 2846b529 authored by catch's avatar catch

Issue #2633644 by rlhawk, mondrake, r_sharma08: Correct empty text does not...

Issue #2633644 by rlhawk, mondrake, r_sharma08: Correct empty text does not display when there are no image styles
parent 40bf8be8
......@@ -91,9 +91,9 @@ public function getDefaultOperations(EntityInterface $entity) {
*/
public function render() {
$build = parent::render();
$build['#empty'] = $this->t('There are currently no styles. <a href=":url">Add a new one</a>.', array(
$build['table']['#empty'] = $this->t('There are currently no styles. <a href=":url">Add a new one</a>.', [
':url' => $this->urlGenerator->generateFromRoute('image.style_add'),
));
]);
return $build;
}
......
......@@ -274,6 +274,19 @@ function testStyle() {
$this->assertFalse(ImageStyle::load($style_name), format_string('Image style %style successfully deleted.', array('%style' => $style->label())));
// Test empty text when there are no image styles.
// Delete all image styles.
foreach (ImageStyle::loadMultiple() as $image_style) {
$image_style->delete();
}
// Confirm that the empty text is correct on the image styles page.
$this->drupalGet($admin_path);
$this->assertRaw(t('There are currently no styles. <a href=":url">Add a new one</a>.', [
':url' => \Drupal::url('image.style_add'),
]));
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment