Unverified Commit 27c80649 authored by alexpott's avatar alexpott

Issue #2942588 by mohit1604, chr.fritsch, tstoeckler, bojanz, joshi.rohit100,...

Issue #2942588 by mohit1604, chr.fritsch, tstoeckler, bojanz, joshi.rohit100, hchonov: EntityListBuilder::render() should use the entity type plural label in the empty text
parent d45dc9d2
...@@ -107,7 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ...@@ -107,7 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form[$this->entitiesKey] = [ $form[$this->entitiesKey] = [
'#type' => 'table', '#type' => 'table',
'#header' => $this->buildHeader(), '#header' => $this->buildHeader(),
'#empty' => t('There is no @label yet.', ['@label' => $this->entityType->getLabel()]), '#empty' => t('There are no @label yet.', ['@label' => $this->entityType->getPluralLabel()]),
'#tabledrag' => [ '#tabledrag' => [
[ [
'action' => 'order', 'action' => 'order',
......
...@@ -223,7 +223,7 @@ public function render() { ...@@ -223,7 +223,7 @@ public function render() {
'#header' => $this->buildHeader(), '#header' => $this->buildHeader(),
'#title' => $this->getTitle(), '#title' => $this->getTitle(),
'#rows' => [], '#rows' => [],
'#empty' => $this->t('There is no @label yet.', ['@label' => $this->entityType->getLabel()]), '#empty' => $this->t('There are no @label yet.', ['@label' => $this->entityType->getPluralLabel()]),
'#cache' => [ '#cache' => [
'contexts' => $this->entityType->getListCacheContexts(), 'contexts' => $this->entityType->getListCacheContexts(),
'tags' => $this->entityType->getListCacheTags(), 'tags' => $this->entityType->getListCacheTags(),
......
...@@ -31,7 +31,7 @@ public function testEmptyActionList() { ...@@ -31,7 +31,7 @@ public function testEmptyActionList() {
$actions = $storage->loadMultiple(); $actions = $storage->loadMultiple();
$storage->delete($actions); $storage->delete($actions);
$this->drupalGet('/admin/config/system/actions'); $this->drupalGet('/admin/config/system/actions');
$this->assertRaw('There is no Action yet.'); $this->assertRaw('There are no actions yet.');
} }
} }
...@@ -103,7 +103,7 @@ public function testListing() { ...@@ -103,7 +103,7 @@ public function testListing() {
$this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.'); $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.');
// Confirm that the empty text is displayed. // Confirm that the empty text is displayed.
$this->assertText(t('There is no Custom block yet.')); $this->assertText(t('There are no custom blocks yet.'));
} }
} }
...@@ -243,7 +243,7 @@ public function testListUI() { ...@@ -243,7 +243,7 @@ public function testListUI() {
$this->assertNoFieldByXpath('//td', 'dotted.default', "No machine name found for deleted 'Default' entity."); $this->assertNoFieldByXpath('//td', 'dotted.default', "No machine name found for deleted 'Default' entity.");
// Confirm that the empty text is displayed. // Confirm that the empty text is displayed.
$this->assertText('There is no Test configuration yet.'); $this->assertText('There are no test configuration entities yet.');
} }
/** /**
......
...@@ -35,7 +35,7 @@ protected function setUp() { ...@@ -35,7 +35,7 @@ protected function setUp() {
public function testResponsiveImageAdmin() { public function testResponsiveImageAdmin() {
// We start without any default styles. // We start without any default styles.
$this->drupalGet('admin/config/media/responsive-image-style'); $this->drupalGet('admin/config/media/responsive-image-style');
$this->assertText('There is no Responsive image style yet.'); $this->assertText('There are no responsive image styles yet.');
// Add a responsive image style. // Add a responsive image style.
$this->drupalGet('admin/config/media/responsive-image-style/add'); $this->drupalGet('admin/config/media/responsive-image-style/add');
...@@ -54,7 +54,7 @@ public function testResponsiveImageAdmin() { ...@@ -54,7 +54,7 @@ public function testResponsiveImageAdmin() {
// Check if the new group is created. // Check if the new group is created.
$this->assertResponse(200); $this->assertResponse(200);
$this->drupalGet('admin/config/media/responsive-image-style'); $this->drupalGet('admin/config/media/responsive-image-style');
$this->assertNoText('There is no Responsive image style yet.'); $this->assertNoText('There are no responsive image styles yet.');
$this->assertText('Style One'); $this->assertText('Style One');
$this->assertText('style_one'); $this->assertText('style_one');
...@@ -137,7 +137,7 @@ public function testResponsiveImageAdmin() { ...@@ -137,7 +137,7 @@ public function testResponsiveImageAdmin() {
$this->drupalGet('admin/config/media/responsive-image-style/style_one/delete'); $this->drupalGet('admin/config/media/responsive-image-style/style_one/delete');
$this->drupalPostForm(NULL, [], t('Delete')); $this->drupalPostForm(NULL, [], t('Delete'));
$this->drupalGet('admin/config/media/responsive-image-style'); $this->drupalGet('admin/config/media/responsive-image-style');
$this->assertText('There is no Responsive image style yet.'); $this->assertText('There are no responsive image styles yet.');
} }
} }
...@@ -49,7 +49,7 @@ public function testWorkflowUiWithNoType() { ...@@ -49,7 +49,7 @@ public function testWorkflowUiWithNoType() {
$this->drupalGet('admin/config/workflow/workflows'); $this->drupalGet('admin/config/workflow/workflows');
$this->assertSession()->pageTextNotContains('There are no workflow types available. In order to create workflows you need to install a module that provides a workflow type. For example, the Content Moderation module provides a workflow type that enables workflows for content entities.'); $this->assertSession()->pageTextNotContains('There are no workflow types available. In order to create workflows you need to install a module that provides a workflow type. For example, the Content Moderation module provides a workflow type that enables workflows for content entities.');
$this->assertSession()->linkExists('Add workflow'); $this->assertSession()->linkExists('Add workflow');
$this->assertSession()->pageTextContains('There is no Workflow yet.'); $this->assertSession()->pageTextContains('There are no workflows yet.');
} }
} }
...@@ -109,7 +109,7 @@ public function testWorkflowCreation() { ...@@ -109,7 +109,7 @@ public function testWorkflowCreation() {
$this->assertSession()->linkByHrefExists('admin/config/workflow/workflows'); $this->assertSession()->linkByHrefExists('admin/config/workflow/workflows');
$this->clickLink('Workflows'); $this->clickLink('Workflows');
$this->assertSession()->pageTextContains('Workflows'); $this->assertSession()->pageTextContains('Workflows');
$this->assertSession()->pageTextContains('There is no Workflow yet.'); $this->assertSession()->pageTextContains('There are no workflows yet.');
$this->clickLink('Add workflow'); $this->clickLink('Add workflow');
$this->submitForm(['label' => 'Test', 'id' => 'test', 'workflow_type' => 'workflow_type_test'], 'Save'); $this->submitForm(['label' => 'Test', 'id' => 'test', 'workflow_type' => 'workflow_type_test'], 'Save');
$this->assertSession()->pageTextContains('Created the Test Workflow.'); $this->assertSession()->pageTextContains('Created the Test Workflow.');
...@@ -253,7 +253,7 @@ public function testWorkflowCreation() { ...@@ -253,7 +253,7 @@ public function testWorkflowCreation() {
$this->assertSession()->pageTextContains('Are you sure you want to delete Test?'); $this->assertSession()->pageTextContains('Are you sure you want to delete Test?');
$this->submitForm([], 'Delete'); $this->submitForm([], 'Delete');
$this->assertSession()->pageTextContains('Workflow Test deleted.'); $this->assertSession()->pageTextContains('Workflow Test deleted.');
$this->assertSession()->pageTextContains('There is no Workflow yet.'); $this->assertSession()->pageTextContains('There are no workflows yet.');
$this->assertNull($workflow_storage->loadUnchanged('test'), 'The test workflow has been deleted'); $this->assertNull($workflow_storage->loadUnchanged('test'), 'The test workflow has been deleted');
// Ensure that workflow types with default configuration are initialized // Ensure that workflow types with default configuration are initialized
......
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