summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-12-05 14:38:38 +0000
committerAlex Pott2014-12-05 14:38:38 +0000
commit3ec63481f793e559fc1246f453a03a71bc1aafdc (patch)
treeb163a223ddecb32bb15d7db8fcf1533b8fe74dbd
parentf503eb9c21dadf9c08c6ccf19207ac067a7f3c01 (diff)
Issue #2384487 by rpayanm, daffie, Sharique, areke: Make the class variables protected for FilterFormat
-rw-r--r--core/modules/editor/src/Tests/QuickEditIntegrationTest.php2
-rw-r--r--core/modules/filter/filter.module6
-rw-r--r--core/modules/filter/src/Controller/FilterController.php2
-rw-r--r--core/modules/filter/src/Element/TextFormat.php2
-rw-r--r--core/modules/filter/src/Entity/FilterFormat.php6
-rw-r--r--core/modules/filter/src/Tests/FilterAdminTest.php8
-rw-r--r--core/modules/filter/src/Tests/FilterCrudTest.php18
-rw-r--r--core/modules/filter/src/Tests/FilterDefaultFormatTest.php10
-rw-r--r--core/modules/filter/src/Tests/FilterFormatAccessTest.php26
-rw-r--r--core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php2
-rw-r--r--core/modules/system/src/Tests/Menu/BreadcrumbTest.php2
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyTestBase.php2
-rw-r--r--core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php2
-rw-r--r--core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php2
-rw-r--r--core/modules/text/src/Tests/TextFieldTest.php4
-rw-r--r--core/modules/user/src/Tests/UserSignatureTest.php4
-rw-r--r--core/modules/views/src/Tests/DefaultViewsTest.php2
17 files changed, 50 insertions, 50 deletions
diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
index 28b0f4b..33077c3 100644
--- a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
+++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php
@@ -95,7 +95,7 @@ class QuickEditIntegrationTest extends QuickEditTestBase {
// Associate text editor with text format.
$editor = entity_create('editor', array(
- 'format' => $full_html_format->format,
+ 'format' => $full_html_format->id(),
'editor' => 'unicorn',
));
$editor->save();
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 538467a..bd3d072 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -156,7 +156,7 @@ function filter_formats(AccountInterface $account = NULL) {
$formats['user'][$account_id] = array();
foreach ($formats['all'] as $format) {
if ($format->access('use', $account)) {
- $formats['user'][$account_id][$format->format] = $format;
+ $formats['user'][$account_id][$format->id()] = $format;
}
}
}
@@ -246,7 +246,7 @@ function filter_default_format(AccountInterface $account = NULL) {
// available is the user's default format.
$formats = filter_formats($account);
$format = reset($formats);
- return $format->format;
+ return $format->id();
}
/**
@@ -408,7 +408,7 @@ function template_preprocess_filter_guidelines(&$variables) {
$format = $variables['format'];
$variables['tips'] = array(
'#theme' => 'filter_tips',
- '#tips' => _filter_tips($format->format, FALSE),
+ '#tips' => _filter_tips($format->id(), FALSE),
);
}
diff --git a/core/modules/filter/src/Controller/FilterController.php b/core/modules/filter/src/Controller/FilterController.php
index fe4d94f..a921cb0 100644
--- a/core/modules/filter/src/Controller/FilterController.php
+++ b/core/modules/filter/src/Controller/FilterController.php
@@ -26,7 +26,7 @@ class FilterController {
* @see template_preprocess_filter_tips()
*/
function filterTips(FilterFormatInterface $filter_format = NULL) {
- $tips = $filter_format ? $filter_format->format : -1;
+ $tips = $filter_format ? $filter_format->id() : -1;
$build = array(
'#theme' => 'filter_tips',
diff --git a/core/modules/filter/src/Element/TextFormat.php b/core/modules/filter/src/Element/TextFormat.php
index 25ef62c..aaff8b4 100644
--- a/core/modules/filter/src/Element/TextFormat.php
+++ b/core/modules/filter/src/Element/TextFormat.php
@@ -133,7 +133,7 @@ class TextFormat extends RenderElement {
if (!isset($element['#format']) && !empty($formats)) {
// If no text format was selected, use the allowed format with the highest
// weight. This is equivalent to calling filter_default_format().
- $element['#format'] = reset($formats)->format;
+ $element['#format'] = reset($formats)->id();
}
// If #allowed_formats is set, the list of formats must not be modified in
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index 0b7c6af..9c37809 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -53,7 +53,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
*
* @var string
*/
- public $format;
+ protected $format;
/**
* Unique label of the text format.
@@ -66,7 +66,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
*
* @var string
*/
- public $name;
+ protected $name;
/**
* Weight of this format in the text format selector.
@@ -76,7 +76,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
*
* @var int
*/
- public $weight = 0;
+ protected $weight = 0;
/**
* List of user role IDs to grant access to use this format on initial creation.
diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php
index 77d0760..67c4dea 100644
--- a/core/modules/filter/src/Tests/FilterAdminTest.php
+++ b/core/modules/filter/src/Tests/FilterAdminTest.php
@@ -244,13 +244,13 @@ class FilterAdminTest extends WebTestBase {
filter_formats_reset();
$format = entity_load('filter_format', $edit['format']);
$this->assertNotNull($format, 'Format found in database.');
- $this->drupalGet('admin/config/content/formats/manage/' . $format->format);
+ $this->drupalGet('admin/config/content/formats/manage/' . $format->id());
$this->assertFieldByName('roles[' . DRUPAL_AUTHENTICATED_RID . ']', '', 'Role found.');
$this->assertFieldByName('filters[' . $second_filter . '][status]', '', 'Line break filter found.');
$this->assertFieldByName('filters[' . $first_filter . '][status]', '', 'Url filter found.');
// Disable new filter.
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format->format . '/disable', array(), t('Disable'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format->id() . '/disable', array(), t('Disable'));
$this->assertUrl('admin/config/content/formats');
$this->assertRaw(t('Disabled text format %format.', array('%format' => $edit['name'])), 'Format successfully disabled.');
@@ -261,7 +261,7 @@ class FilterAdminTest extends WebTestBase {
$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->name)), '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);
@@ -319,7 +319,7 @@ class FilterAdminTest extends WebTestBase {
$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->name)), '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 70ea342..a64c28f 100644
--- a/core/modules/filter/src/Tests/FilterCrudTest.php
+++ b/core/modules/filter/src/Tests/FilterCrudTest.php
@@ -29,8 +29,8 @@ class FilterCrudTest extends KernelTestBase {
function testTextFormatCrud() {
// Add a text format with minimum data only.
$format = entity_create('filter_format');
- $format->format = 'empty_format';
- $format->name = 'Empty format';
+ $format->set('format', 'empty_format');
+ $format->set('name', 'Empty format');
$format->save();
$this->verifyTextFormat($format);
@@ -49,7 +49,7 @@ class FilterCrudTest extends KernelTestBase {
$this->verifyTextFormat($format);
// Alter some text format properties and save again.
- $format->name = 'Altered format';
+ $format->set('name', 'Altered format');
$format->setFilterConfig('filter_url', array(
'status' => 0,
));
@@ -70,21 +70,21 @@ class FilterCrudTest extends KernelTestBase {
$format->disable()->save();
$formats = filter_formats();
- $this->assertTrue(!isset($formats[$format->format]), 'filter_formats: Disabled text format no longer exists.');
+ $this->assertTrue(!isset($formats[$format->id()]), 'filter_formats: Disabled text format no longer exists.');
}
/**
* Verifies that a text format is properly stored.
*/
function verifyTextFormat($format) {
- $t_args = array('%format' => $format->name);
+ $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->format);
- $this->assertEqual($filter_format->format, $format->format, format_string('filter_format_load: Proper format id for text format %format.', $t_args));
- $this->assertEqual($filter_format->name, $format->name, format_string('filter_format_load: Proper title for text format %format.', $t_args));
- $this->assertEqual($filter_format->weight, $format->weight, format_string('filter_format_load: Proper weight for text format %format.', $t_args));
+ $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->label(), $format->label(), format_string('filter_format_load: Proper title for text format %format.', $t_args));
+ $this->assertEqual($filter_format->get('weight'), $format->get('weight'), 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/FilterDefaultFormatTest.php b/core/modules/filter/src/Tests/FilterDefaultFormatTest.php
index 73d048d..2ec62aa 100644
--- a/core/modules/filter/src/Tests/FilterDefaultFormatTest.php
+++ b/core/modules/filter/src/Tests/FilterDefaultFormatTest.php
@@ -50,24 +50,24 @@ class FilterDefaultFormatTest extends WebTestBase {
// Adjust the weights so that the first and second formats (in that order)
// are the two lowest weighted formats available to any user.
$edit = array();
- $edit['formats[' . $first_format->format . '][weight]'] = -2;
- $edit['formats[' . $second_format->format . '][weight]'] = -1;
+ $edit['formats[' . $first_format->id() . '][weight]'] = -2;
+ $edit['formats[' . $second_format->id() . '][weight]'] = -1;
$this->drupalPostForm('admin/config/content/formats', $edit, t('Save changes'));
$this->resetFilterCaches();
// Check that each user's default format is the lowest weighted format that
// the user has access to.
$actual = filter_default_format($first_user);
- $expected = $first_format->format;
+ $expected = $first_format->id();
$this->assertEqual($actual, $expected, "First user's default format $actual is the expected lowest weighted format $expected that the user has access to.");
$actual = filter_default_format($second_user);
- $expected = $second_format->format;
+ $expected = $second_format->id();
$this->assertEqual($actual, $expected, "Second user's default format $actual is the expected lowest weighted format $expected that the user has access to, and different to the first user's.");
// Reorder the two formats, and check that both users now have the same
// default.
$edit = array();
- $edit['formats[' . $second_format->format . '][weight]'] = -3;
+ $edit['formats[' . $second_format->id() . '][weight]'] = -3;
$this->drupalPostForm('admin/config/content/formats', $edit, t('Save changes'));
$this->resetFilterCaches();
$this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), 'After the formats are reordered, both users have the same default format.');
diff --git a/core/modules/filter/src/Tests/FilterFormatAccessTest.php b/core/modules/filter/src/Tests/FilterFormatAccessTest.php
index 843372b..a42dd8c 100644
--- a/core/modules/filter/src/Tests/FilterFormatAccessTest.php
+++ b/core/modules/filter/src/Tests/FilterFormatAccessTest.php
@@ -132,8 +132,8 @@ class FilterFormatAccessTest extends WebTestBase {
// Perform similar checks as above, but now against the entire list of
// available formats for this user.
- $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_formats($this->web_user))), 'The allowed format appears in the list of available formats for a regular user.');
- $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_formats($this->web_user))), 'The disallowed format does not appear in the list of available formats for a regular user.');
+ $this->assertTrue(in_array($this->allowed_format->id(), array_keys(filter_formats($this->web_user))), 'The allowed format appears in the list of available formats for a regular user.');
+ $this->assertFalse(in_array($this->disallowed_format->id(), array_keys(filter_formats($this->web_user))), 'The disallowed format does not appear in the list of available formats for a regular user.');
$this->assertTrue(in_array(filter_fallback_format(), array_keys(filter_formats($this->web_user))), 'The fallback format appears in the list of available formats for a regular user.');
// Make sure that a regular user only has permission to use the format
@@ -147,20 +147,20 @@ class FilterFormatAccessTest extends WebTestBase {
$this->drupalGet('node/add/page');
$elements = $this->xpath('//select[@name=:name]/option', array(
':name' => 'body[0][format]',
- ':option' => $this->allowed_format->format,
+ ':option' => $this->allowed_format->id(),
));
$options = array();
foreach ($elements as $element) {
$options[(string) $element['value']] = $element;
}
- $this->assertTrue(isset($options[$this->allowed_format->format]), 'The allowed text format appears as an option when adding a new node.');
- $this->assertFalse(isset($options[$this->disallowed_format->format]), 'The disallowed text format does not appear as an option when adding a new node.');
+ $this->assertTrue(isset($options[$this->allowed_format->id()]), 'The allowed text format appears as an option when adding a new node.');
+ $this->assertFalse(isset($options[$this->disallowed_format->id()]), 'The disallowed text format does not appear as an option when adding a new node.');
$this->assertFalse(isset($options[filter_fallback_format()]), 'The fallback format does not appear as an option when adding a new node.');
// Check regular user access to the filter tips pages.
- $this->drupalGet('filter/tips/' . $this->allowed_format->format);
+ $this->drupalGet('filter/tips/' . $this->allowed_format->id());
$this->assertResponse(200);
- $this->drupalGet('filter/tips/' . $this->disallowed_format->format);
+ $this->drupalGet('filter/tips/' . $this->disallowed_format->id());
$this->assertResponse(403);
$this->drupalGet('filter/tips/' . filter_fallback_format());
$this->assertResponse(200);
@@ -169,9 +169,9 @@ class FilterFormatAccessTest extends WebTestBase {
// Check admin user access to the filter tips pages.
$this->drupalLogin($this->admin_user);
- $this->drupalGet('filter/tips/' . $this->allowed_format->format);
+ $this->drupalGet('filter/tips/' . $this->allowed_format->id());
$this->assertResponse(200);
- $this->drupalGet('filter/tips/' . $this->disallowed_format->format);
+ $this->drupalGet('filter/tips/' . $this->disallowed_format->id());
$this->assertResponse(200);
$this->drupalGet('filter/tips/' . filter_fallback_format());
$this->assertResponse(200);
@@ -195,8 +195,8 @@ class FilterFormatAccessTest extends WebTestBase {
// Check that the correct text format appears in the list of formats
// available to that role.
- $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_get_formats_by_role($rid))), 'A text format which a role has access to appears in the list of formats available to that role.');
- $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_get_formats_by_role($rid))), 'A text format which a role does not have access to does not appear in the list of formats available to that role.');
+ $this->assertTrue(in_array($this->allowed_format->id(), array_keys(filter_get_formats_by_role($rid))), 'A text format which a role has access to appears in the list of formats available to that role.');
+ $this->assertFalse(in_array($this->disallowed_format->id(), array_keys(filter_get_formats_by_role($rid))), 'A text format which a role does not have access to does not appear in the list of formats available to that role.');
// Check that the fallback format is always allowed.
$this->assertEqual(filter_get_roles_by_format(entity_load('filter_format', filter_fallback_format())), user_role_names(), 'All roles have access to the fallback format.');
@@ -221,7 +221,7 @@ class FilterFormatAccessTest extends WebTestBase {
$edit = array();
$edit['title[0][value]'] = $this->randomMachineName(8);
$edit[$body_value_key] = $this->randomMachineName(16);
- $edit[$body_format_key] = $this->disallowed_format->format;
+ $edit[$body_format_key] = $this->disallowed_format->id();
$this->drupalPostForm('node/add/page', $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
@@ -294,7 +294,7 @@ class FilterFormatAccessTest extends WebTestBase {
// Switch the text format to a new one, then disable that format and all
// other formats on the site (leaving only the fallback format).
$this->drupalLogin($this->admin_user);
- $edit = array($body_format_key => $this->allowed_format->format);
+ $edit = array($body_format_key => $this->allowed_format->id());
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertUrl('node/' . $node->id());
foreach (filter_formats() as $format) {
diff --git a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
index 9a8eb5d..17e841d 100644
--- a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
+++ b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
@@ -203,7 +203,7 @@ class QuickEditAutocompleteTermTest extends WebTestBase {
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
// Use the first available text format.
- 'format' => $format->format,
+ 'format' => $format->id(),
'vid' => $this->vocabulary->id(),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));
diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
index f0b7676..ee54f31 100644
--- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
@@ -115,7 +115,7 @@ class BreadcrumbTest extends MenuTestBase {
// Verify Filter text format administration breadcrumbs.
$filter_formats = filter_formats();
$format = reset($filter_formats);
- $format_id = $format->format;
+ $format_id = $format->id();
$trail = $config + array(
'admin/config/content' => t('Content authoring'),
);
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
index 396c1f8..9a1436c 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php
@@ -69,7 +69,7 @@ abstract class TaxonomyTestBase extends WebTestBase {
'description' => array(
'value' => $this->randomMachineName(),
// Use the first available text format.
- 'format' => $format->format,
+ 'format' => $format->id(),
),
'vid' => $vocabulary->id(),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
index a8c7633..b7fe1e9 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
@@ -168,7 +168,7 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
$term = entity_create('taxonomy_term', array(
'name' => $properties['name'],
'description' => $properties['description'],
- 'format' => $format->format,
+ 'format' => $format->id(),
'vid' => $this->vocabulary->id(),
'langcode' => $properties['langcode'],
));
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php
index ec0d257..b7a3528 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php
@@ -134,7 +134,7 @@ abstract class TaxonomyTestBase extends ViewTestBase {
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
// Use the first available text format.
- 'format' => $format->format,
+ 'format' => $format->id(),
'vid' => $this->vocabulary->id(),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));
diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php
index f47fdd7..104051a 100644
--- a/core/modules/text/src/Tests/TextFieldTest.php
+++ b/core/modules/text/src/Tests/TextFieldTest.php
@@ -114,7 +114,7 @@ class TextFieldTest extends StringFieldTest {
$this->drupalLogin($this->adminUser);
foreach (filter_formats() as $format) {
if (!$format->isFallbackFormat()) {
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format->format . '/disable', array(), t('Disable'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format->id() . '/disable', array(), t('Disable'));
}
}
$this->drupalLogin($this->webUser);
@@ -153,7 +153,7 @@ class TextFieldTest extends StringFieldTest {
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
filter_formats_reset();
$format = entity_load('filter_format', $edit['format']);
- $format_id = $format->format;
+ $format_id = $format->id();
$permission = $format->getPermissionName();
$roles = $this->webUser->getRoles();
$rid = $roles[0];
diff --git a/core/modules/user/src/Tests/UserSignatureTest.php b/core/modules/user/src/Tests/UserSignatureTest.php
index 1eb9af7..71f3148 100644
--- a/core/modules/user/src/Tests/UserSignatureTest.php
+++ b/core/modules/user/src/Tests/UserSignatureTest.php
@@ -119,13 +119,13 @@ class UserSignatureTest extends WebTestBase {
// Log in as an administrator and edit the comment to use Full HTML, so
// that the comment text itself is not filtered at all.
$this->drupalLogin($this->admin_user);
- $edit['comment_body[0][format]'] = $this->full_html_format->format;
+ $edit['comment_body[0][format]'] = $this->full_html_format->id();
$this->drupalPostForm('comment/' . $comment_id . '/edit', $edit, t('Save'));
// Assert that the signature did not make it through unfiltered.
$this->drupalGet('node/' . $node->id());
$this->assertNoRaw($signature_text, 'Unfiltered signature text not found.');
- $this->assertRaw(check_markup($signature_text, $this->filtered_html_format->format), 'Filtered signature text found.');
+ $this->assertRaw(check_markup($signature_text, $this->filtered_html_format->id()), 'Filtered signature text found.');
// Verify that the user signature's text format's cache tag is present.
$this->drupalGet('node/' . $node->id());
$this->assertTrue(in_array('filter_format:filtered_html_format', explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'))));
diff --git a/core/modules/views/src/Tests/DefaultViewsTest.php b/core/modules/views/src/Tests/DefaultViewsTest.php
index 15b49a4..43aae1f 100644
--- a/core/modules/views/src/Tests/DefaultViewsTest.php
+++ b/core/modules/views/src/Tests/DefaultViewsTest.php
@@ -158,7 +158,7 @@ class DefaultViewsTest extends ViewTestBase {
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
// Use the first available text format.
- 'format' => $format->format,
+ 'format' => $format->id(),
'vid' => $vocabulary->id(),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));