Loading core/modules/node/tests/src/Functional/NodeAdminTest.php +3 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ class NodeAdminTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * A user with permission to bypass access content. Loading Loading @@ -104,8 +104,7 @@ public function testContentAdminSort() { $this->drupalGet('admin/content'); foreach ($nodes_query as $delta => $string) { // Verify that the node was found in the correct order. $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table[contains(@class, :class)]/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':class' => 'views-table', $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':label' => $string, ])); } Loading @@ -121,8 +120,7 @@ public function testContentAdminSort() { $this->drupalGet('admin/content', ['query' => ['sort' => 'asc', 'order' => 'title']]); foreach ($nodes_query as $delta => $string) { // Verify that the node was found in the correct order. $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table[contains(@class, :class)]/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':class' => 'views-table', $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':label' => $string, ])); } Loading core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class NodeDisplayConfigurableTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * {@inheritdoc} Loading Loading @@ -167,6 +167,8 @@ public function provideThemes() { return [ ['bartik', 'header', TRUE], ['claro', 'footer', TRUE], // @todo Remove Classy from data provider in // https://www.drupal.org/project/drupal/issues/3110137. ['classy', 'footer', TRUE], // @todo Add coverage for olivero after fixing // https://www.drupal.org/project/drupal/issues/3215220. Loading core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class NodeFieldMultilingualTest extends BrowserTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -140,7 +140,7 @@ public function testMultilingualDisplaySettings() { // Check if node body is showed. $this->drupalGet('node/' . $node->id()); $this->assertSession()->elementTextEquals('xpath', "//article[contains(concat(' ', normalize-space(@class), ' '), ' node ')]//div[contains(concat(' ', normalize-space(@class), ' '), 'node__content')]/descendant::p", $node->body->value); $this->assertSession()->elementTextEquals('xpath', "//article/div//p", $node->body->value); } } core/modules/node/tests/src/Functional/NodePostSettingsTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ class NodePostSettingsTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -46,7 +46,7 @@ public function testPagePostInfo() { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $this->assertSession()->elementsCount('xpath', '//div[contains(@class, "node__submitted")]', 1); $this->assertSession()->pageTextContainsOnce('Submitted by'); $node->delete(); // Set "Basic page" content type to display post information. Loading @@ -63,7 +63,7 @@ public function testPagePostInfo() { $this->submitForm($edit, 'Save'); // Check that the post information is not displayed. $this->assertSession()->elementNotExists('xpath', '//div[contains(@class, "node__submitted")]'); $this->assertSession()->pageTextNotContains('Submitted by'); } } core/modules/node/tests/src/Functional/NodeTitleTest.php +8 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\Component\Utility\Html; use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait; /** * Tests node title. Loading @@ -13,6 +14,7 @@ class NodeTitleTest extends NodeTestBase { use CommentTestTrait; use AssertBreadcrumbTrait; /** * Modules to enable. Loading @@ -24,7 +26,7 @@ class NodeTitleTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * A user with permission to bypass access content. Loading Loading @@ -70,12 +72,13 @@ public function testNodeTitle() { $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label() . ' | Drupal', 'Page title is equal to node title.'); // Test breadcrumb in comment preview. $this->drupalGet('comment/reply/node/' . $node->id() . '/comment'); $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a'; $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label(), 'Node breadcrumb is equal to node title.'); $this->assertBreadcrumb('comment/reply/node/' . $node->id() . '/comment', [ '' => 'Home', 'node/' . $node->id() => $node->label(), ]); // Verify that node preview title is equal to node title. $this->assertSession()->elementTextEquals('xpath', "//article[contains(concat(' ', normalize-space(@class), ' '), ' node--type-{$node->bundle()} ')]/h2/a/span", $node->label()); $this->assertSession()->elementTextEquals('xpath', "//article/h2/a/span", $node->label()); // Test node title is clickable on teaser list (/node). $this->drupalGet('node'); Loading Loading
core/modules/node/tests/src/Functional/NodeAdminTest.php +3 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ class NodeAdminTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * A user with permission to bypass access content. Loading Loading @@ -104,8 +104,7 @@ public function testContentAdminSort() { $this->drupalGet('admin/content'); foreach ($nodes_query as $delta => $string) { // Verify that the node was found in the correct order. $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table[contains(@class, :class)]/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':class' => 'views-table', $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':label' => $string, ])); } Loading @@ -121,8 +120,7 @@ public function testContentAdminSort() { $this->drupalGet('admin/content', ['query' => ['sort' => 'asc', 'order' => 'title']]); foreach ($nodes_query as $delta => $string) { // Verify that the node was found in the correct order. $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table[contains(@class, :class)]/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':class' => 'views-table', $this->assertSession()->elementExists('xpath', $this->assertSession()->buildXPathQuery('//table/tbody/tr[' . ($delta + 1) . ']/td[2]/a[normalize-space(text())=:label]', [ ':label' => $string, ])); } Loading
core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class NodeDisplayConfigurableTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * {@inheritdoc} Loading Loading @@ -167,6 +167,8 @@ public function provideThemes() { return [ ['bartik', 'header', TRUE], ['claro', 'footer', TRUE], // @todo Remove Classy from data provider in // https://www.drupal.org/project/drupal/issues/3110137. ['classy', 'footer', TRUE], // @todo Add coverage for olivero after fixing // https://www.drupal.org/project/drupal/issues/3215220. Loading
core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class NodeFieldMultilingualTest extends BrowserTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -140,7 +140,7 @@ public function testMultilingualDisplaySettings() { // Check if node body is showed. $this->drupalGet('node/' . $node->id()); $this->assertSession()->elementTextEquals('xpath', "//article[contains(concat(' ', normalize-space(@class), ' '), ' node ')]//div[contains(concat(' ', normalize-space(@class), ' '), 'node__content')]/descendant::p", $node->body->value); $this->assertSession()->elementTextEquals('xpath', "//article/div//p", $node->body->value); } }
core/modules/node/tests/src/Functional/NodePostSettingsTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ class NodePostSettingsTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; protected function setUp(): void { parent::setUp(); Loading Loading @@ -46,7 +46,7 @@ public function testPagePostInfo() { // Check that the post information is displayed. $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $this->assertSession()->elementsCount('xpath', '//div[contains(@class, "node__submitted")]', 1); $this->assertSession()->pageTextContainsOnce('Submitted by'); $node->delete(); // Set "Basic page" content type to display post information. Loading @@ -63,7 +63,7 @@ public function testPagePostInfo() { $this->submitForm($edit, 'Save'); // Check that the post information is not displayed. $this->assertSession()->elementNotExists('xpath', '//div[contains(@class, "node__submitted")]'); $this->assertSession()->pageTextNotContains('Submitted by'); } }
core/modules/node/tests/src/Functional/NodeTitleTest.php +8 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\Component\Utility\Html; use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait; /** * Tests node title. Loading @@ -13,6 +14,7 @@ class NodeTitleTest extends NodeTestBase { use CommentTestTrait; use AssertBreadcrumbTrait; /** * Modules to enable. Loading @@ -24,7 +26,7 @@ class NodeTitleTest extends NodeTestBase { /** * {@inheritdoc} */ protected $defaultTheme = 'classy'; protected $defaultTheme = 'stark'; /** * A user with permission to bypass access content. Loading Loading @@ -70,12 +72,13 @@ public function testNodeTitle() { $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label() . ' | Drupal', 'Page title is equal to node title.'); // Test breadcrumb in comment preview. $this->drupalGet('comment/reply/node/' . $node->id() . '/comment'); $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a'; $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label(), 'Node breadcrumb is equal to node title.'); $this->assertBreadcrumb('comment/reply/node/' . $node->id() . '/comment', [ '' => 'Home', 'node/' . $node->id() => $node->label(), ]); // Verify that node preview title is equal to node title. $this->assertSession()->elementTextEquals('xpath', "//article[contains(concat(' ', normalize-space(@class), ' '), ' node--type-{$node->bundle()} ')]/h2/a/span", $node->label()); $this->assertSession()->elementTextEquals('xpath', "//article/h2/a/span", $node->label()); // Test node title is clickable on teaser list (/node). $this->drupalGet('node'); Loading