X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fhistory%2Fsrc%2FTests%2FViews%2FHistoryTimestampTest.php;fp=web%2Fcore%2Fmodules%2Fhistory%2Fsrc%2FTests%2FViews%2FHistoryTimestampTest.php;h=0000000000000000000000000000000000000000;hp=476653839285115b2b42d7b965af3dbef47b0f74;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/history/src/Tests/Views/HistoryTimestampTest.php b/web/core/modules/history/src/Tests/Views/HistoryTimestampTest.php deleted file mode 100644 index 476653839..000000000 --- a/web/core/modules/history/src/Tests/Views/HistoryTimestampTest.php +++ /dev/null @@ -1,89 +0,0 @@ -drupalCreateNode(); - $nodes[] = $this->drupalCreateNode(); - - $account = $this->drupalCreateUser(); - $this->drupalLogin($account); - \Drupal::currentUser()->setAccount($account); - - db_insert('history') - ->fields([ - 'uid' => $account->id(), - 'nid' => $nodes[0]->id(), - 'timestamp' => REQUEST_TIME - 100, - ])->execute(); - - db_insert('history') - ->fields([ - 'uid' => $account->id(), - 'nid' => $nodes[1]->id(), - 'timestamp' => REQUEST_TIME + 100, - ])->execute(); - - - $column_map = [ - 'nid' => 'nid', - ]; - - // Test the history field. - $view = Views::getView('test_history'); - $view->setDisplay('page_1'); - $this->executeView($view); - $this->assertEqual(count($view->result), 2); - $output = $view->preview(); - $this->setRawContent(\Drupal::service('renderer')->renderRoot($output)); - $result = $this->xpath('//span[@class=:class]', [':class' => 'marker']); - $this->assertEqual(count($result), 1, 'Just one node is marked as new'); - - // Test the history filter. - $view = Views::getView('test_history'); - $view->setDisplay('page_2'); - $this->executeView($view); - $this->assertEqual(count($view->result), 1); - $this->assertIdenticalResultset($view, [['nid' => $nodes[0]->id()]], $column_map); - - // Install Comment module and make sure that content types without comment - // field will not break the view. - // See \Drupal\history\Plugin\views\filter\HistoryUserTimestamp::query() - \Drupal::service('module_installer')->install(['comment']); - $view = Views::getView('test_history'); - $view->setDisplay('page_2'); - $this->executeView($view); - - } - -}