assertHistoryMetadata example

public function testTrackerHistoryMetadata() {
    $this->drupalLogin($this->user);

    // Create a page node.     $edit = [
      'title' => $this->randomMachineName(8),
    ];
    $node = $this->drupalCreateNode($edit);

    // Verify that the history metadata is present.     $this->drupalGet('activity');
    $this->assertHistoryMetadata($node->id()$node->getChangedTime()$node->getChangedTime());
    $this->drupalGet('activity/' . $this->user->id());
    $this->assertHistoryMetadata($node->id()$node->getChangedTime()$node->getChangedTime());
    $this->drupalGet('user/' . $this->user->id() . '/activity');
    $this->assertHistoryMetadata($node->id()$node->getChangedTime()$node->getChangedTime());

    // Add a comment to the page, make sure it is created after the node by     // sleeping for one second, to ensure the last comment timestamp is     // different from before.     $comment = [
      'subject[0][value]' => $this->randomMachineName(),
      'comment_body[0][value]' => $this->randomMachineName(20),
    ];
Home | Imprint | This part of the site doesn't use cookies.