diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php index 1ff2812560a..c82ee511d09 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php @@ -17,11 +17,11 @@ use Drupal\Core\Language\Language; class CommentPreviewTest extends CommentTestBase { /** - * Use the standard profile. + * Modules to enable. * - * @var string + * @var array */ - protected $profile = 'standard'; + public static $modules = array('image'); public static function getInfo() { return array( @@ -31,6 +31,32 @@ class CommentPreviewTest extends CommentTestBase { ); } + function setUp() { + parent::setUp(); + + // Create user picture field. + module_load_install('user'); + user_install_picture_field(); + + // Add the basic_html filter format from the standard install profile. + $filter_format_storage_controller = $this->container->get('plugin.manager.entity')->getStorageController('filter_format'); + $filter_format = $filter_format_storage_controller->create(array( + 'format' => 'basic_html', + 'name' => 'Basic HTML', + 'status' => '1', + 'roles' => array('authenticated'), + ), 'filter_format'); + + $filter_format->setFilterConfig('filter_html', array( + 'module' => 'filter', + 'status' => '1', + 'settings' => array( + 'allowed_html' => '
    1. ', + ), + )); + $filter_format->save(); + } + /** * Tests comment preview. */