'article', 'title' => 'Article test ' . $i, ])->save(); } $this->enableViewsTestModule(); $this->view = Views::getView('test_excluded_field_token_display'); $this->view->setDisplay('rest_export_1'); } /** * Tests the display of an excluded title field when used as a token. */ public function testExcludedTitleTokenDisplay() { $actual_json = $this->drupalGet($this->view->getPath(), ['query' => ['_format' => 'json']]); $this->assertResponse(200); $expected = [ ['nothing' => 'Article test 10'], ['nothing' => 'Article test 9'], ['nothing' => 'Article test 8'], ['nothing' => 'Article test 7'], ['nothing' => 'Article test 6'], ['nothing' => 'Article test 5'], ['nothing' => 'Article test 4'], ['nothing' => 'Article test 3'], ['nothing' => 'Article test 2'], ['nothing' => 'Article test 1'], ]; $this->assertIdentical($actual_json, json_encode($expected)); } }