diff --git a/core/modules/user/src/Tests/UserUsernameTest.php b/core/modules/user/src/Tests/UserUsernameTest.php index e6573a3..73ec68c 100644 --- a/core/modules/user/src/Tests/UserUsernameTest.php +++ b/core/modules/user/src/Tests/UserUsernameTest.php @@ -9,6 +9,7 @@ use Drupal\Component\Utility\String; use Drupal\Component\Utility\Unicode; +use Drupal\comment\Tests\CommentTestTrait; use Drupal\simpletest\WebTestBase; /** @@ -18,6 +19,8 @@ */ class UserUsernameTest extends WebTestBase { + use CommentTestTrait; + /** * Modules to enable. * @@ -50,8 +53,8 @@ class UserUsernameTest extends WebTestBase { public function setUp() { parent::setUp(); - $this->drupalCreateContentType(array('type' => 'article')); - $this->container->get('comment.manager')->addDefaultField('node', 'article'); + $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); + $this->addDefaultCommentField('node', 'article'); // Create user with short username. $this->userShortName = $this->drupalCreateUser(