diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php index 16a2d3d..af63fec 100644 --- a/core/modules/filter/src/Entity/FilterFormat.php +++ b/core/modules/filter/src/Entity/FilterFormat.php @@ -126,20 +126,6 @@ public function id() { /** * {@inheritdoc} */ - public function getLabel() { - return $this->label; - } - - /** - * {@inheritdoc} - */ - public function getLabelCallback() { - return 'getLabel'; - } - - /** - * {@inheritdoc} - */ public function getRoles() { return $this->roles; } @@ -266,7 +252,7 @@ public function preSave(EntityStorageInterface $storage) { parent::preSave($storage); - $this->label = trim($this->getLabel()); + $this->label = trim($this->label()); } /** diff --git a/core/modules/filter/src/FilterFormatInterface.php b/core/modules/filter/src/FilterFormatInterface.php index 5359c55..dd89b53 100644 --- a/core/modules/filter/src/FilterFormatInterface.php +++ b/core/modules/filter/src/FilterFormatInterface.php @@ -85,22 +85,6 @@ public function getFilterTypes(); public function getHtmlRestrictions(); /** - * Returns the unique label of the text format. - * - * @return string - * The label of this format. - */ - public function getLabel(); - - /** - * Returns the callback to retrieve the label for the FilterFormat entity type - * - * @return string - * The callback to retrieve the label for this format. - */ - public function getLabelCallback(); - - /** * Returns the weight of the format in the text format selector. * * @return int diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php index ef0953e..6d1bf09 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -260,7 +260,7 @@ function testFilterAdmin() { $edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1; $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration')); $this->assertUrl('admin/config/content/formats'); - $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->getLabel())), 'Full HTML format successfully updated.'); + $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->label())), 'Full HTML format successfully updated.'); // Switch user. $this->drupalLogin($this->web_user); @@ -318,7 +318,7 @@ function testFilterAdmin() { $edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = FALSE; $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration')); $this->assertUrl('admin/config/content/formats'); - $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->getLabel())), 'Full HTML format successfully reverted.'); + $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->label())), 'Full HTML format successfully reverted.'); $this->drupalGet('admin/config/content/formats/manage/' . $full); $this->assertFieldByName('roles[' . DRUPAL_AUTHENTICATED_RID . ']', $edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'], 'Changes reverted.'); diff --git a/core/modules/filter/src/Tests/FilterCrudTest.php b/core/modules/filter/src/Tests/FilterCrudTest.php index de46a6d..a28328a 100644 --- a/core/modules/filter/src/Tests/FilterCrudTest.php +++ b/core/modules/filter/src/Tests/FilterCrudTest.php @@ -77,13 +77,13 @@ function testTextFormatCrud() { * Verifies that a text format is properly stored. */ function verifyTextFormat($format) { - $t_args = array('%format' => $format->getLabel()); + $t_args = array('%format' => $format->label()); $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Verify the loaded filter has all properties. $filter_format = entity_load('filter_format', $format->id()); $this->assertEqual($filter_format->id(), $format->id(), format_string('filter_format_load: Proper format id for text format %format.', $t_args)); - $this->assertEqual($filter_format->getLabel(), $format->getLabel(), format_string('filter_format_load: Proper title for text format %format.', $t_args)); + $this->assertEqual($filter_format->label(), $format->label(), format_string('filter_format_load: Proper title for text format %format.', $t_args)); $this->assertEqual($filter_format->getWeight(), $format->getWeight(), format_string('filter_format_load: Proper weight for text format %format.', $t_args)); // Check that the filter was created in site default language. $this->assertEqual($format->language()->getId(), $default_langcode, format_string('filter_format_load: Proper language code for text format %format.', $t_args)); diff --git a/core/modules/filter/src/Tests/FilterFormatMethodsTest.php b/core/modules/filter/src/Tests/FilterFormatMethodsTest.php index 1fb0da0..b940dc7 100644 --- a/core/modules/filter/src/Tests/FilterFormatMethodsTest.php +++ b/core/modules/filter/src/Tests/FilterFormatMethodsTest.php @@ -53,8 +53,8 @@ public function setUp() { */ function testGetWeight() { $weight = 0; - $this->assertIdentical(spl_object_hash($this->format->setWeight($weight)), spl_object_hash($this->format), format_string('Test weight set method for text format %format.', array('%format' => $this->format->getLabel()))); - $this->assertIdentical($this->format->getWeight(), $weight, format_string('Test weight get method for text format %format.', array('%format' => $this->format->getLabel()))); + $this->assertIdentical(spl_object_hash($this->format->setWeight($weight)), spl_object_hash($this->format), format_string('Test weight set method for text format %format.', array('%format' => $this->format->label()))); + $this->assertIdentical($this->format->getWeight(), $weight, format_string('Test weight get method for text format %format.', array('%format' => $this->format->label()))); } /** @@ -62,8 +62,8 @@ function testGetWeight() { */ function testGetRoles() { $roles = array(0,1); - $this->assertIdentical(spl_object_hash($this->format->setRoles($roles)), spl_object_hash($this->format), format_string('Test roles set method for text format %format.', array('%format' => $this->format->getLabel()))); - $this->assertIdentical($this->format->getRoles(), $roles, format_string('Test roles get method for text format %format.', array('%format' => $this->format->getLabel()))); + $this->assertIdentical(spl_object_hash($this->format->setRoles($roles)), spl_object_hash($this->format), format_string('Test roles set method for text format %format.', array('%format' => $this->format->label()))); + $this->assertIdentical($this->format->getRoles(), $roles, format_string('Test roles get method for text format %format.', array('%format' => $this->format->label()))); } /** @@ -71,8 +71,8 @@ function testGetRoles() { */ function testIsCacheable() { $is_cacheable = TRUE; - $this->assertIdentical(spl_object_hash($this->format->setCache($is_cacheable)), spl_object_hash($this->format), format_string('Test cache set method for text format %format.', array('%format' => $this->format->getLabel()))); - $this->assertIdentical($this->format->isCacheable(), $is_cacheable, format_string('Test cache get method for text format %format.', array('%format' => $this->format->getLabel()))); + $this->assertIdentical(spl_object_hash($this->format->setCache($is_cacheable)), spl_object_hash($this->format), format_string('Test cache set method for text format %format.', array('%format' => $this->format->label()))); + $this->assertIdentical($this->format->isCacheable(), $is_cacheable, format_string('Test cache get method for text format %format.', array('%format' => $this->format->label()))); } }