Loading core/modules/comment/tests/src/Functional/CommentAdminTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class CommentAdminTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading core/modules/comment/tests/src/Functional/CommentAnonymousTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ class CommentAnonymousTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -50,7 +50,7 @@ public function testAnonymous() { $this->drupalGet($this->node->toUrl()); $this->submitForm($edit, 'Preview'); // Cannot use assertRaw here since both title and body are in the form. $preview = (string) $this->cssSelect('.preview')[0]->getHtml(); $preview = (string) $this->cssSelect('[data-drupal-selector="edit-comment-preview"]')[0]->getHtml(); $this->assertStringContainsString($title, $preview, 'Anonymous user can preview comment title.'); $this->assertStringContainsString($body, $preview, 'Anonymous user can preview comment body.'); Loading @@ -64,7 +64,7 @@ public function testAnonymous() { $this->drupalGet($this->node->toUrl()); $this->submitForm($edit, 'Preview'); // Cannot use assertRaw here since both title and body are in the form. $preview = (string) $this->cssSelect('.preview')[0]->getHtml(); $preview = (string) $this->cssSelect('[data-drupal-selector="edit-comment-preview"]')[0]->getHtml(); $this->assertStringContainsString($title, $preview, 'Anonymous user can preview comment title.'); $this->assertStringContainsString($body, $preview, 'Anonymous user can preview comment body.'); user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['skip comment approval']); Loading core/modules/comment/tests/src/Functional/CommentCSSTest.php +8 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,14 @@ class CommentCSSTest extends CommentTestBase { use GeneratePermutationsTrait; /** * {@inheritdoc} * The theme to install as the default for testing. * * @var string * * @todo This test's reliance on classes makes Stark a bad fit as a base * theme. Change the default theme to Starterkit once it is stable. * * @see https://www.drupal.org/project/drupal/issues/3267890 */ protected $defaultTheme = 'classy'; Loading core/modules/comment/tests/src/Functional/CommentFieldsTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class CommentFieldsTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * Tests that the default 'comment_body' field is correctly added. Loading Loading @@ -85,13 +85,13 @@ public function testCommentFieldDelete() { $this->drupalLogin($this->webUser); $this->drupalGet('node/' . $node->nid->value); $elements = $this->cssSelect('.field--type-comment'); $elements = $this->cssSelect('.comment-form'); $this->assertCount(2, $elements, 'There are two comment fields on the node.'); // Delete the first comment field. FieldStorageConfig::loadByName('node', 'comment')->delete(); $this->drupalGet('node/' . $node->nid->value); $elements = $this->cssSelect('.field--type-comment'); $elements = $this->cssSelect('.comment-form'); $this->assertCount(1, $elements, 'There is one comment field on the node.'); } Loading core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ class CommentInterfaceTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * Set up comments to have subject and preview disabled. Loading Loading @@ -90,7 +90,7 @@ public function testCommentInterface() { $arguments = [ ':link' => base_path() . 'comment/' . $comment->id() . '#comment-' . $comment->id(), ]; $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@href,:link) and text()="Permalink"]'; $pattern_permalink = '//footer/a[contains(@href,:link) and text()="Permalink"]'; $permalink = $this->xpath($pattern_permalink, $arguments); $this->assertNotEmpty($permalink, 'Permalink link found.'); Loading Loading @@ -316,7 +316,7 @@ public function testViewMode() { $this->postComment($this->node, $comment_text); // Comment displayed in 'default' display mode found and has body text. $comment_element = $this->cssSelect('.comment-wrapper'); $comment_element = $this->cssSelect('#comment-1'); $this->assertNotEmpty($comment_element); $this->assertSession()->responseContains('<p>' . $comment_text . '</p>'); Loading Loading @@ -349,7 +349,7 @@ public function testViewMode() { $this->drupalGet($this->node->toUrl()); // The comment should exist but without the body text because we used $mode // mode this time. $comment_element = $this->cssSelect('.comment-wrapper'); $comment_element = $this->cssSelect('#comment-1'); $this->assertNotEmpty($comment_element); $this->assertSession()->responseNotContains('<p>' . $comment_text . '</p>'); } Loading Loading
core/modules/comment/tests/src/Functional/CommentAdminTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ class CommentAdminTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading
core/modules/comment/tests/src/Functional/CommentAnonymousTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ class CommentAnonymousTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -50,7 +50,7 @@ public function testAnonymous() { $this->drupalGet($this->node->toUrl()); $this->submitForm($edit, 'Preview'); // Cannot use assertRaw here since both title and body are in the form. $preview = (string) $this->cssSelect('.preview')[0]->getHtml(); $preview = (string) $this->cssSelect('[data-drupal-selector="edit-comment-preview"]')[0]->getHtml(); $this->assertStringContainsString($title, $preview, 'Anonymous user can preview comment title.'); $this->assertStringContainsString($body, $preview, 'Anonymous user can preview comment body.'); Loading @@ -64,7 +64,7 @@ public function testAnonymous() { $this->drupalGet($this->node->toUrl()); $this->submitForm($edit, 'Preview'); // Cannot use assertRaw here since both title and body are in the form. $preview = (string) $this->cssSelect('.preview')[0]->getHtml(); $preview = (string) $this->cssSelect('[data-drupal-selector="edit-comment-preview"]')[0]->getHtml(); $this->assertStringContainsString($title, $preview, 'Anonymous user can preview comment title.'); $this->assertStringContainsString($body, $preview, 'Anonymous user can preview comment body.'); user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['skip comment approval']); Loading
core/modules/comment/tests/src/Functional/CommentCSSTest.php +8 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,14 @@ class CommentCSSTest extends CommentTestBase { use GeneratePermutationsTrait; /** * {@inheritdoc} * The theme to install as the default for testing. * * @var string * * @todo This test's reliance on classes makes Stark a bad fit as a base * theme. Change the default theme to Starterkit once it is stable. * * @see https://www.drupal.org/project/drupal/issues/3267890 */ protected $defaultTheme = 'classy'; Loading
core/modules/comment/tests/src/Functional/CommentFieldsTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class CommentFieldsTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * Tests that the default 'comment_body' field is correctly added. Loading Loading @@ -85,13 +85,13 @@ public function testCommentFieldDelete() { $this->drupalLogin($this->webUser); $this->drupalGet('node/' . $node->nid->value); $elements = $this->cssSelect('.field--type-comment'); $elements = $this->cssSelect('.comment-form'); $this->assertCount(2, $elements, 'There are two comment fields on the node.'); // Delete the first comment field. FieldStorageConfig::loadByName('node', 'comment')->delete(); $this->drupalGet('node/' . $node->nid->value); $elements = $this->cssSelect('.field--type-comment'); $elements = $this->cssSelect('.comment-form'); $this->assertCount(1, $elements, 'There is one comment field on the node.'); } Loading
core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ class CommentInterfaceTest extends CommentTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * Set up comments to have subject and preview disabled. Loading Loading @@ -90,7 +90,7 @@ public function testCommentInterface() { $arguments = [ ':link' => base_path() . 'comment/' . $comment->id() . '#comment-' . $comment->id(), ]; $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@href,:link) and text()="Permalink"]'; $pattern_permalink = '//footer/a[contains(@href,:link) and text()="Permalink"]'; $permalink = $this->xpath($pattern_permalink, $arguments); $this->assertNotEmpty($permalink, 'Permalink link found.'); Loading Loading @@ -316,7 +316,7 @@ public function testViewMode() { $this->postComment($this->node, $comment_text); // Comment displayed in 'default' display mode found and has body text. $comment_element = $this->cssSelect('.comment-wrapper'); $comment_element = $this->cssSelect('#comment-1'); $this->assertNotEmpty($comment_element); $this->assertSession()->responseContains('<p>' . $comment_text . '</p>'); Loading Loading @@ -349,7 +349,7 @@ public function testViewMode() { $this->drupalGet($this->node->toUrl()); // The comment should exist but without the body text because we used $mode // mode this time. $comment_element = $this->cssSelect('.comment-wrapper'); $comment_element = $this->cssSelect('#comment-1'); $this->assertNotEmpty($comment_element); $this->assertSession()->responseNotContains('<p>' . $comment_text . '</p>'); } Loading