diff --git a/core/modules/block/src/Tests/BlockTestBase.php b/core/modules/block/src/Tests/BlockTestBase.php index 5e59114a73d7df8b744bab12c77ba2e060341545..e87b633e6aed3923f2338efdf606f78d7c8a401d 100644 --- a/core/modules/block/src/Tests/BlockTestBase.php +++ b/core/modules/block/src/Tests/BlockTestBase.php @@ -8,6 +8,7 @@ namespace Drupal\block\Tests; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Provides setup and helper methods for block module tests. @@ -42,7 +43,7 @@ protected function setUp() { $this->config('system.site')->set('page.front', '/test-page')->save(); // Create Full HTML text format. - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', )); diff --git a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php index da06bd4f2468d72ac6de0fc8259f1759911fd2e2..75df6e043834642b0e559f214c577f854c0cbd1d 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php @@ -11,6 +11,7 @@ use Drupal\editor\Entity\Editor; use Drupal\filter\FilterFormatInterface; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests administration of CKEditor. @@ -37,7 +38,7 @@ protected function setUp() { parent::setUp(); // Create text format. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php index 8ee31ac59d03724cf179261a42fc948bb491019b..feba8ecd7d50943229bae7309219b235a4ca9cf9 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php @@ -9,6 +9,7 @@ use Drupal\editor\Entity\Editor; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests loading of CKEditor. @@ -42,7 +43,7 @@ protected function setUp() { parent::setUp(); // Create text format, associate CKEditor. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, @@ -57,7 +58,7 @@ protected function setUp() { // Create a second format without an associated editor so a drop down select // list is created when selecting formats. - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, diff --git a/core/modules/ckeditor/src/Tests/CKEditorPluginManagerTest.php b/core/modules/ckeditor/src/Tests/CKEditorPluginManagerTest.php index 86aaf7e93d7f6e9b246213841663d2d8548d9e60..b664f81b88b54178988cc0c8ce886773a7f16856 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorPluginManagerTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorPluginManagerTest.php @@ -9,6 +9,7 @@ use Drupal\editor\Entity\Editor; use Drupal\simpletest\KernelTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests different ways of enabling CKEditor plugins. @@ -38,7 +39,7 @@ protected function setUp() { $this->installSchema('system', 'url_alias'); // Create text format, associate CKEditor. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/ckeditor/src/Tests/CKEditorTest.php b/core/modules/ckeditor/src/Tests/CKEditorTest.php index 3948ac29a28e50a9ea8a83878c69baad7b1d5eb3..929acca6698a8e4e5b7fefe23404d3c6232a0f27 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorTest.php @@ -10,6 +10,7 @@ use Drupal\simpletest\KernelTestBase; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\editor\Entity\Editor; +use Drupal\filter\Entity\FilterFormat; /** * Tests for the 'CKEditor' text editor plugin. @@ -46,7 +47,7 @@ protected function setUp() { $this->installSchema('system', 'url_alias'); // Create text format, associate CKEditor. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php index 88c6c8f9173d3723ee8f147319235cfecbacdd27..352ce81bbbe791e66efffa743b6c08f9c8d42450 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php @@ -14,6 +14,7 @@ use Drupal\simpletest\WebTestBase; use Drupal\shortcut\Entity\ShortcutSet; use Drupal\contact\Entity\ContactForm; +use Drupal\filter\Entity\FilterFormat; /** * Visit all lists. @@ -260,7 +261,7 @@ public function doContentTypeListTest() { public function doFormatsListTest() { // Create a test format to decouple looking for translate operations // link so this does not test more than necessary. - $filter_format = entity_create('filter_format', array( + $filter_format = FilterFormat::create(array( 'format' => Unicode::strtolower($this->randomMachineName(16)), 'name' => $this->randomMachineName(), )); diff --git a/core/modules/editor/src/Tests/EditorAdminTest.php b/core/modules/editor/src/Tests/EditorAdminTest.php index bc2591218babcef291e35f6ea67fecaf2963848d..8172f30fae68e16eb4a78bc5ccf3913f3afffd07 100644 --- a/core/modules/editor/src/Tests/EditorAdminTest.php +++ b/core/modules/editor/src/Tests/EditorAdminTest.php @@ -38,7 +38,7 @@ protected function setUp() { parent::setUp(); // Add text format. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/editor/src/Tests/EditorFileUsageTest.php b/core/modules/editor/src/Tests/EditorFileUsageTest.php index b4c892af82f029d2f738b446fbc4aab3dff3818a..e49ddb144d7655b0183132fe9e76d73fa75ba6c5 100644 --- a/core/modules/editor/src/Tests/EditorFileUsageTest.php +++ b/core/modules/editor/src/Tests/EditorFileUsageTest.php @@ -12,6 +12,7 @@ use Drupal\system\Tests\Entity\EntityUnitTestBase; use Drupal\field\Entity\FieldStorageConfig; use Drupal\Core\Field\FieldStorageDefinitionInterface; +use Drupal\filter\Entity\FilterFormat; /** * Tests tracking of file usage by the Text Editor module. @@ -35,7 +36,7 @@ protected function setUp() { $this->installConfig(['node']); // Add text formats. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/editor/src/Tests/EditorLoadingTest.php b/core/modules/editor/src/Tests/EditorLoadingTest.php index eb4e08a11bc729d004c48c882d856ac4eb0a560f..1511711b8e66954f943eed3305f171aaef92b0cc 100644 --- a/core/modules/editor/src/Tests/EditorLoadingTest.php +++ b/core/modules/editor/src/Tests/EditorLoadingTest.php @@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests loading of text editors. @@ -56,14 +57,14 @@ protected function setUp() { \Drupal::service('plugin.manager.editor')->clearCachedDefinitions(); // Add text formats. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, 'filters' => array(), )); $filtered_html_format->save(); - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, diff --git a/core/modules/editor/src/Tests/EditorManagerTest.php b/core/modules/editor/src/Tests/EditorManagerTest.php index 996d9286b72a33a4d4dfade4c76a9ba4d0e84a37..2dd0cf507cb087869c7fc7e5836baaa4b2c6ec81 100644 --- a/core/modules/editor/src/Tests/EditorManagerTest.php +++ b/core/modules/editor/src/Tests/EditorManagerTest.php @@ -9,6 +9,7 @@ use Drupal\editor\Entity\Editor; use Drupal\simpletest\KernelTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests detection of text editors and correct generation of attachments. @@ -38,14 +39,14 @@ protected function setUp() { $this->installSchema('system', 'url_alias'); // Add text formats. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, 'filters' => array(), )); $filtered_html_format->save(); - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php index 5800a16b8b1a28416fcd00df1734daa685dbd1de..16f2bb67336b5cb385f0d0ace308281a75110952 100644 --- a/core/modules/editor/src/Tests/EditorSecurityTest.php +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php @@ -10,6 +10,7 @@ use Drupal\Component\Serialization\Json; use Drupal\editor\Entity\Editor; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests XSS protection for content creators when using text editors. @@ -87,7 +88,7 @@ protected function setUp() { // With text formats 2, 3 and 5, we also associate a text editor that does // not guarantee XSS safety. "restricted" means the text format has XSS // filters on output, "unrestricted" means the opposite. - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'restricted_without_editor', 'name' => 'Restricted HTML, without text editor', 'weight' => 0, @@ -102,7 +103,7 @@ protected function setUp() { ), )); $format->save(); - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'restricted_with_editor', 'name' => 'Restricted HTML, with text editor', 'weight' => 1, @@ -122,7 +123,7 @@ protected function setUp() { 'editor' => 'unicorn', ]); $editor->save(); - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'restricted_plus_dangerous_tag_with_editor', 'name' => 'Restricted HTML, dangerous tag allowed, with text editor', 'weight' => 1, @@ -142,14 +143,14 @@ protected function setUp() { 'editor' => 'unicorn', ]); $editor->save(); - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'unrestricted_without_editor', 'name' => 'Unrestricted HTML, without text editor', 'weight' => 0, 'filters' => array(), )); $format->save(); - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'unrestricted_with_editor', 'name' => 'Unrestricted HTML, with text editor', 'weight' => 1, diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php index 8f4ec18e32d5d190f870f78eb7091960426f5cc7..af5623fbcceae68561bae7a232ae35469ee64f85 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php @@ -10,6 +10,7 @@ use Drupal\Component\Serialization\Json; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests Quick Edit module integration endpoints. @@ -36,7 +37,7 @@ protected function setUp() { parent::setUp(); // Create a text format. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php index 820cab6dcb4f6496d732c252111aec6616d15212..db8c3eb19b104ecf764345b9dec8d82dbc07e95b 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; +use Drupal\filter\Entity\FilterFormat; /** * Tests Edit module integration (Editor module's inline editing support). @@ -87,7 +88,7 @@ protected function setUp() { ); // Create text format. - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, @@ -103,7 +104,7 @@ protected function setUp() { $editor->save(); // Also create a text format without an associated text editor. - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'no_editor', 'name' => 'No Text Editor', 'weight' => 2, diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php index 6d0d0a83c6f047d67bb238b80e6c974c22424d52..5379750ae2f583574205e8f905ebc246c0e26402 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php @@ -103,7 +103,7 @@ protected function setUp() { )) ->save(); - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', ))->save(); diff --git a/core/modules/filter/src/Tests/FilterAPITest.php b/core/modules/filter/src/Tests/FilterAPITest.php index 5fd99998959a9274d6ef75aabe2d6679cd2f3f8a..a6a3d565c970ab5a9fb1ce87a9f21dbb57378acc 100644 --- a/core/modules/filter/src/Tests/FilterAPITest.php +++ b/core/modules/filter/src/Tests/FilterAPITest.php @@ -11,7 +11,8 @@ use Drupal\Core\Session\AnonymousUserSession; use Drupal\Core\TypedData\OptionsProviderInterface; use Drupal\Core\TypedData\DataDefinition; -use Drupal\filter\Plugin\DataType\FilterFormat; +use Drupal\filter\Entity\FilterFormat; +use Drupal\filter\Plugin\DataType\FilterFormat as FilterFormatDataType; use Drupal\filter\Plugin\FilterInterface; use Drupal\system\Tests\Entity\EntityUnitTestBase; use Symfony\Component\Validator\ConstraintViolationListInterface; @@ -36,7 +37,7 @@ protected function setUp() { */ function testCheckMarkupFilterOrder() { // Create crazy HTML format. - $crazy_format = entity_create('filter_format', array( + $crazy_format = FilterFormat::create(array( 'format' => 'crazy', 'name' => 'Crazy', 'weight' => 1, @@ -138,7 +139,7 @@ function testFilterFormatAPI() { ); // Test on stupid_filtered_html, where nothing is allowed. - $stupid_filtered_html_format = entity_create('filter_format', array( + $stupid_filtered_html_format = FilterFormat::create(array( 'format' => 'stupid_filtered_html', 'name' => 'Stupid Filtered HTML', 'filters' => array( @@ -164,7 +165,7 @@ function testFilterFormatAPI() { // Test on very_restricted_html, where there's two different filters of the // FilterInterface::TYPE_HTML_RESTRICTOR type, each restricting in different ways. - $very_restricted_html_format = entity_create('filter_format', array( + $very_restricted_html_format = FilterFormat::create(array( 'format' => 'very_restricted_html', 'name' => 'Very Restricted HTML', 'filters' => array( @@ -254,7 +255,7 @@ function testFilterFormatAPI() { * This test focuses solely on those advanced features. */ function testProcessedTextElement() { - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'element_test', 'name' => 'processed_text element test format', 'filters' => array( @@ -401,7 +402,7 @@ function testTypedDataAPI() { */ public function testFilterFormatPreSave() { /** @var \Drupal\filter\FilterFormatInterface $crazy_format */ - $crazy_format = entity_create('filter_format', array( + $crazy_format = FilterFormat::create(array( 'format' => 'crazy', 'name' => 'Crazy', 'weight' => 1, @@ -451,7 +452,7 @@ public function testFilterFormatPreSave() { public function assertFilterFormatViolation(ConstraintViolationListInterface $violations, $invalid_value) { $filter_format_violation_found = FALSE; foreach ($violations as $violation) { - if ($violation->getRoot() instanceof FilterFormat && $violation->getInvalidValue() === $invalid_value) { + if ($violation->getRoot() instanceof FilterFormatDataType && $violation->getInvalidValue() === $invalid_value) { $filter_format_violation_found = TRUE; break; } diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php index 0c61a9ed2314a1f26bcd5fcfde747e618d77d1d7..78dbfcbb4018d17ddb0b70b6662750a1ef587237 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -50,7 +50,7 @@ protected function setUp() { $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); // Set up the filter formats used by this test. - $basic_html_format = entity_create('filter_format', array( + $basic_html_format = FilterFormat::create(array( 'format' => 'basic_html', 'name' => 'Basic HTML', 'filters' => array( @@ -63,7 +63,7 @@ protected function setUp() { ), )); $basic_html_format->save(); - $restricted_html_format = entity_create('filter_format', array( + $restricted_html_format = FilterFormat::create(array( 'format' => 'restricted_html', 'name' => 'Restricted HTML', 'filters' => array( @@ -89,7 +89,7 @@ protected function setUp() { ), )); $restricted_html_format->save(); - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, diff --git a/core/modules/filter/src/Tests/FilterCrudTest.php b/core/modules/filter/src/Tests/FilterCrudTest.php index 00a25fcde6f597cd01b0c2498cbf77c7d58edebb..db0516b43254af60f5f279a5d64afe9ae91fa645 100644 --- a/core/modules/filter/src/Tests/FilterCrudTest.php +++ b/core/modules/filter/src/Tests/FilterCrudTest.php @@ -29,14 +29,15 @@ class FilterCrudTest extends KernelTestBase { */ function testTextFormatCrud() { // Add a text format with minimum data only. - $format = entity_create('filter_format'); - $format->set('format', 'empty_format'); - $format->set('name', 'Empty format'); + $format = FilterFormat::create(array( + 'format' => 'empty_format', + 'name' => 'Empty format', + )); $format->save(); $this->verifyTextFormat($format); // Add another text format specifying all possible properties. - $format = entity_create('filter_format', array( + $format = FilterFormat::create(array( 'format' => 'custom_format', 'name' => 'Custom format', )); diff --git a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php index 9d96c5f3b0f9f6e2a4ff3f7b95c1443432d937ce..aaa8c8ba72e61152ab652b55709e25b0d58d859d 100644 --- a/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php +++ b/core/modules/filter/src/Tests/FilterHtmlImageSecureTest.php @@ -10,6 +10,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests restriction of IMG tags in HTML input. @@ -38,7 +39,7 @@ protected function setUp() { parent::setUp(); // Setup Filtered HTML text format. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'filters' => array( diff --git a/core/modules/filter/src/Tests/FilterSettingsTest.php b/core/modules/filter/src/Tests/FilterSettingsTest.php index 9b953368875693a3afe2ea4ce1b16e849c438f7c..fdd3270dbcc7d8fafb6aae16ae8bd81e20187d3d 100644 --- a/core/modules/filter/src/Tests/FilterSettingsTest.php +++ b/core/modules/filter/src/Tests/FilterSettingsTest.php @@ -8,6 +8,7 @@ namespace Drupal\filter\Tests; use Drupal\simpletest\KernelTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests filter settings. @@ -30,7 +31,7 @@ function testFilterDefaults() { $filter_info = $this->container->get('plugin.manager.filter')->getDefinitions(); // Create text format using filter default settings. - $filter_defaults_format = entity_create('filter_format', array( + $filter_defaults_format = FilterFormat::create(array( 'format' => 'filter_defaults', 'name' => 'Filter defaults', )); diff --git a/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php b/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php index 033570323016ebd9404efc8a0679aaa43c7330d8..17babeed3f888ad4aa52d757c8ec455001d3c156 100644 --- a/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php +++ b/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php @@ -10,6 +10,7 @@ use Drupal\quickedit\EditorSelector; use Drupal\quickedit\MetadataGenerator; use Drupal\quickedit_test\MockEditEntityFieldAccessCheck; +use Drupal\filter\Entity\FilterFormat; /** * Tests in-place field editing metadata. @@ -149,7 +150,7 @@ public function testEditorWithCustomMetadata() { ); // Create a text format. - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, diff --git a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php index 6e6fffb9ab570dd1adc2b6a2ab24170c8065c38d..57fc0baef7c97411d4278520b6a9308e593500d0 100644 --- a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php +++ b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php @@ -17,6 +17,7 @@ use Drupal\node\Entity\Node; use Drupal\node\Entity\NodeType; use Drupal\simpletest\WebTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests loading of in-place editing functionality and lazy loading of its @@ -57,7 +58,7 @@ protected function setUp() { parent::setUp(); // Create a text format. - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, diff --git a/core/modules/search/src/Tests/SearchCommentTest.php b/core/modules/search/src/Tests/SearchCommentTest.php index d7f725541958eef4f6968fcb7085603786efc703..faec0896e39c646210eeffa6330a7e57f48c2d4b 100644 --- a/core/modules/search/src/Tests/SearchCommentTest.php +++ b/core/modules/search/src/Tests/SearchCommentTest.php @@ -11,6 +11,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\field\Entity\FieldConfig; use Drupal\user\RoleInterface; +use Drupal\filter\Entity\FilterFormat; /** * Tests integration searching comments. @@ -59,7 +60,7 @@ class SearchCommentTest extends SearchTestBase { protected function setUp() { parent::setUp(); - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, @@ -90,7 +91,7 @@ protected function setUp() { function testSearchResultsComment() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); // Create basic_html format that escapes all HTML. - $basic_html_format = entity_create('filter_format', array( + $basic_html_format = FilterFormat::create(array( 'format' => 'basic_html', 'name' => 'Basic HTML', 'weight' => 1, diff --git a/core/modules/search/src/Tests/SearchRankingTest.php b/core/modules/search/src/Tests/SearchRankingTest.php index 4f12cdf5f096a3523da928204e91f5f85a35f4bf..6c9f0e9fd19498b3c41d66d43cfe1fb3dd59b84e 100644 --- a/core/modules/search/src/Tests/SearchRankingTest.php +++ b/core/modules/search/src/Tests/SearchRankingTest.php @@ -10,6 +10,7 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; use Drupal\comment\Tests\CommentTestTrait; use Drupal\Core\Url; +use Drupal\filter\Entity\FilterFormat; /** * Indexes content and tests ranking factors. @@ -203,7 +204,7 @@ public function testRankings() { * Test rankings of HTML tags. */ public function testHTMLRankings() { - $full_html_format = entity_create('filter_format', array( + $full_html_format = FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', )); diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php index f0e5af0a7a1f1cc0474503db7c9430c7a47c18da..3e6821fdd9b1e1764bcefc48cb549480bec259d5 100644 --- a/core/modules/system/src/Tests/Form/FormTest.php +++ b/core/modules/system/src/Tests/Form/FormTest.php @@ -16,6 +16,7 @@ use Drupal\form_test\Form\FormTestDisabledElementsForm; use Drupal\simpletest\WebTestBase; use Drupal\user\RoleInterface; +use Drupal\filter\Entity\FilterFormat; /** * Tests various form element validation mechanisms. @@ -34,7 +35,7 @@ class FormTest extends WebTestBase { protected function setUp() { parent::setUp(); - $filtered_html_format = entity_create('filter_format', array( + $filtered_html_format = FilterFormat::create(array( 'format' => 'filtered_html', 'name' => 'Filtered HTML', )); diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php index eb141cb9760439595d9af977d7698bc33697cda2..ca444072185bd4a2335a171e4874d103314dc210 100644 --- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php +++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php @@ -46,7 +46,7 @@ class TextFormatterTest extends EntityUnitTestBase { protected function setUp() { parent::setUp(); - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'my_text_format', 'name' => 'My text format', 'filters' => array( diff --git a/core/modules/text/src/Tests/TextSummaryTest.php b/core/modules/text/src/Tests/TextSummaryTest.php index 7b1dfabf9d6d789d24bab5818aba447a79620d41..bd3904840a36fb9b46caa9b89bead0963d7d988f 100644 --- a/core/modules/text/src/Tests/TextSummaryTest.php +++ b/core/modules/text/src/Tests/TextSummaryTest.php @@ -8,6 +8,7 @@ namespace Drupal\text\Tests; use Drupal\simpletest\KernelTestBase; +use Drupal\filter\Entity\FilterFormat; /** * Tests text_summary() with different strings and lengths. @@ -55,7 +56,7 @@ function testLongSentence() { * Test various summary length edge cases. */ function testLength() { - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'autop', 'filters' => array( 'filter_autop' => array( @@ -63,7 +64,7 @@ function testLength() { ), ), ))->save(); - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'autop_correct', 'filters' => array( 'filter_autop' => array( diff --git a/core/modules/text/src/Tests/TextWithSummaryItemTest.php b/core/modules/text/src/Tests/TextWithSummaryItemTest.php index 1879919ae28b8fd14a966adc0c0b793966e0b8a8..cf42cbec0bc29eb3f83c069f31b20ea3100289ab 100644 --- a/core/modules/text/src/Tests/TextWithSummaryItemTest.php +++ b/core/modules/text/src/Tests/TextWithSummaryItemTest.php @@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\field\Tests\FieldUnitTestBase; use Drupal\field\Entity\FieldStorageConfig; +use Drupal\filter\Entity\FilterFormat; /** * Tests using entity fields of the text summary field type. @@ -49,7 +50,7 @@ protected function setUp() { // Create the necessary formats. $this->installConfig(array('filter')); - entity_create('filter_format', array( + FilterFormat::create(array( 'format' => 'no_filters', 'filters' => array(), ))->save();