From 01eb824b4703c9327d1e2f13a5be152b3cc8b071 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Wed, 15 Feb 2023 11:55:16 +0000 Subject: [PATCH] Issue #3308919 by smustgrave, Lendude: Fix test performance of Drupal\Tests\user\Functional\UserPictureTest --- .../test_user_config/test_user_config.info.yml | 2 ++ .../tests/src/Functional/UserPictureTest.php | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/modules/system/tests/modules/test_user_config/test_user_config.info.yml b/core/modules/system/tests/modules/test_user_config/test_user_config.info.yml index d7df7fc0a23e..ebc47c092e25 100644 --- a/core/modules/system/tests/modules/test_user_config/test_user_config.info.yml +++ b/core/modules/system/tests/modules/test_user_config/test_user_config.info.yml @@ -5,3 +5,5 @@ package: Testing version: VERSION dependencies: - drupal:user + - drupal:field + - drupal:image diff --git a/core/modules/user/tests/src/Functional/UserPictureTest.php b/core/modules/user/tests/src/Functional/UserPictureTest.php index 6d8fb5c1072c..4c0525331bfb 100644 --- a/core/modules/user/tests/src/Functional/UserPictureTest.php +++ b/core/modules/user/tests/src/Functional/UserPictureTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\user\Functional; +use Drupal\comment\Tests\CommentTestTrait; use Drupal\Core\Database\Database; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\StreamWrapper\StreamWrapperManager; @@ -20,16 +21,16 @@ class UserPictureTest extends BrowserTestBase { use TestFileCreationTrait { getTestFiles as drupalGetTestFiles; } + use CommentTestTrait; /** - * The profile to install as a basis for testing. - * - * Using the standard profile to test user picture config provided by the - * standard profile. - * - * @var string + * {@inheritdoc} */ - protected $profile = 'standard'; + protected static $modules = [ + 'test_user_config', + 'node', + 'comment', + ]; /** * {@inheritdoc} @@ -108,6 +109,9 @@ public function testCreateDeletePicture() { public function testPictureOnNodeComment() { $this->drupalLogin($this->webUser); + $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); + $this->addDefaultCommentField('node', 'article'); + // Save a new picture. $image = current($this->drupalGetTestFiles('image')); $file = $this->saveUserPicture($image); -- GitLab