diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php index 28b0f4b6a684828917a94d34d6de9096844faf59..33077c3414e6fcf801d472dde646558ed165a65a 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php @@ -95,7 +95,7 @@ protected function setUp() { // 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 538467ac970838740c54beb049410a4fcd9d82a6..bd3d072704561284af096aafe6be67a911071a17 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 fe4d94f9b17b3d97faddf8890b7919cf43054140..a921cb0c83c3c2f23bcefcace0b2faaa4bf01353 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 25ef62c8bd5abda93c48d6118d78d891cc320b83..aaff8b42785bb0a4ae3388ff38c3df4f07660aba 100644 --- a/core/modules/filter/src/Element/TextFormat.php +++ b/core/modules/filter/src/Element/TextFormat.php @@ -133,7 +133,7 @@ public static function processFormat(&$element, FormStateInterface $form_state, 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 0b7c6afee95e545bca6250c973e383d32042ef78..9c37809c56ce52740f3d26ca90dd958f33083f84 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 77d07602d49dd57522aea50017697e2417e5110e..67c4deab96b0746670db311a5db78ac6ed0b2b07 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -244,13 +244,13 @@ function testFilterAdmin() { 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 @@ 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->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 @@ 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->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 70ea342db93f9c2c8f67f60a697936f00d74b4cd..a64c28f3cee5f4818253876f871ba56d4256d3c6 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 @@ function testTextFormatCrud() { $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 @@ function testTextFormatCrud() { $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 73d048dd4e2cc536431625fb51684925ac833e44..2ec62aa692528fbf299f724dea323dfb5c08fd05 100644 --- a/core/modules/filter/src/Tests/FilterDefaultFormatTest.php +++ b/core/modules/filter/src/Tests/FilterDefaultFormatTest.php @@ -50,24 +50,24 @@ function testDefaultTextFormats() { // 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 843372b6ca9f9c8b477282324b2f89751a236cc0..a42dd8c160b31c77b91a3d6717fe81466bdc334a 100644 --- a/core/modules/filter/src/Tests/FilterFormatAccessTest.php +++ b/core/modules/filter/src/Tests/FilterFormatAccessTest.php @@ -132,8 +132,8 @@ function testFormatPermissions() { // 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 @@ function testFormatPermissions() { $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 @@ function testFormatPermissions() { // 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 @@ function testFormatRoles() { // 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 @@ function testFormatWidgetPermissions() { $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 @@ function testFormatWidgetPermissions() { // 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 9a8eb5d3e2f70ca56545867053fba5b0237ec7d1..17e841d9bcd238d132084472efc0ccd717beffc6 100644 --- a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php +++ b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php @@ -203,7 +203,7 @@ protected function createTerm() { '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 f0b76766281e098c612de2ecd3b5a08d94f501b9..ee54f3195d52f20647a8d75904820d9123be2da9 100644 --- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php @@ -115,7 +115,7 @@ function testBreadCrumbs() { // 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 396c1f83c44a39a4db8e38244090952bbfca875f..9a1436cd2a6f32a9b552826395f9dd9f6ea2fe7b 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php @@ -69,7 +69,7 @@ function createTerm(Vocabulary $vocabulary, $values = array()) { '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 a8c76330f071f4d8b6fdf77a9aed138f4667d98d..b7fe1e96a505136ac75f3d53856edfe4970f00a0 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php @@ -168,7 +168,7 @@ protected function createTermWithProperties($properties) { $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 ec0d2574c03e6adb96dfd4c7b22f4f91906d40cf..b7a3528bfb6d3f5ec5739913eb031d81adad93a1 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php @@ -134,7 +134,7 @@ protected function createTerm() { '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 f47fdd7f8b6c3a87c7790c97de9eca88b15187b6..104051a4be58e80225c79f95cbc179e1f81cbbf0 100644 --- a/core/modules/text/src/Tests/TextFieldTest.php +++ b/core/modules/text/src/Tests/TextFieldTest.php @@ -114,7 +114,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { $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 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { $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 1eb9af738808362a0cae04ec2e16ca8a0d178236..71f314882b87980d03a2f9377cea6ce52261cbe3 100644 --- a/core/modules/user/src/Tests/UserSignatureTest.php +++ b/core/modules/user/src/Tests/UserSignatureTest.php @@ -119,13 +119,13 @@ function testUserSignature() { // 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 15b49a42dc8e12b4674e7840418b55a3c1acd41b..43aae1fe8b7c27f93a839e84b93f1577bf667c27 100644 --- a/core/modules/views/src/Tests/DefaultViewsTest.php +++ b/core/modules/views/src/Tests/DefaultViewsTest.php @@ -158,7 +158,7 @@ function createTerm($vocabulary) { '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, ));