diff -u b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php --- b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php @@ -87,15 +87,15 @@ $this->drupalLogin($access_user); - // Create some nodes. - $private_node = $this->drupalCreateNode([ - 'title' => $this->t('Private node test'), - 'private' => TRUE, - ]); - $public_node = $this->drupalCreateNode([ - 'title' => $this->t('Public node test'), - 'private' => FALSE, - ]); + // Create some nodes. + $private_node = $this->drupalCreateNode([ + 'title' => 'Private node test', + 'private' => TRUE, + ]); + $public_node = $this->drupalCreateNode([ + 'title' => 'Public node test', + 'private' => FALSE, + ]); // User with access should see both nodes created. $this->drupalGet('activity'); diff -u b/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php --- b/core/modules/tracker/tests/src/Functional/TrackerTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php @@ -155,8 +155,8 @@ ]); $this->drupalGet('user/' . $this->user->id() . '/activity'); - $this->assertNoText($this->nodes['unpublished']->label(), "Unpublished nodes do not show up in the user's tracker listing."); - $this->assertText($this->nodes['my_published']->label(), "Published nodes show up in the user's tracker listing."); + $this->assertSession()->pageTextNotContains($this->nodes['unpublished']->label(), "Unpublished nodes do not show up in the user's tracker listing."); + $this->assertSession()->pageTextContains($this->nodes['my_published']->label(), "Published nodes show up in the user's tracker listing."); // Assert cache contexts. $this->assertCacheContexts([ @@ -349,22 +349,26 @@ /** * Passes if the appropriate history metadata exists. * - * Verify the data-history-node-id, data-history-node-timestamp attribute, - * which is used by the drupal.tracker-history library to add the appropriate - * "new" and "updated" indicators, as well as the "x new" replies link to the - * tracker. We do this in JavaScript to prevent breaking the render cache. + * Verify the data-history-node-id, data-history-node-timestamp and + * data-history-node-last-comment-timestamp attributes, which are used by the + * drupal.tracker-history library to add the appropriate "new" and "updated" + * indicators, as well as the "x new" replies link to the tracker. + * We do this in JavaScript to prevent breaking the render cache. * * @param int $node_id - * A node ID, that must exist as a data-history-node-id attribute. + * A node ID, that must exist as a data-history-node-id attribute * @param int $node_timestamp * A node timestamp, that must exist as a data-history-node-timestamp * attribute. + * @param int $node_last_comment_timestamp + * A node's last comment timestamp, that must exist as a + * data-history-node-last-comment-timestamp attribute. * @param bool $library_is_present * Whether the drupal.tracker-history library should be present or not. * * @internal */ - public function assertHistoryMetadata($node_id, $node_timestamp, $library_is_present = TRUE) { + public function assertHistoryMetadata(int $node_id, int $node_timestamp, int $node_last_comment_timestamp, bool $library_is_present = TRUE): void { $settings = $this->getDrupalSettings(); $this->assertSame($library_is_present, isset($settings['ajaxPageState']) && in_array('tracker/history', explode(',', $settings['ajaxPageState']['libraries'])), 'drupal.tracker-history library is present.'); $this->assertCount(1, $this->xpath('//table/tbody/tr/td[@data-history-node-id="' . $node_id . '" and @data-history-node-timestamp="' . $node_timestamp . '"]'), 'Tracker table cell contains the data-history-node-id and data-history-node-timestamp attributes for the node.');