drupalCreateContentType(['type' => 'test_type']); $node = Node::create([ 'title' => 'test title 1', 'type' => $node_type->id(), ]); $node->save(); $this->nodes[] = $node; $node = Node::create([ 'title' => 'test title 2', 'type' => $node_type->id(), ]); $node->save(); $this->nodes[] = $node; $this->placeBlock('views_block:node_id_argument-block_1', ['region' => 'header']); } /** * Tests rendering caching of a views block with arguments. */ public function testEmptyView() { $this->drupalGet(''); $this->assertEqual([], $this->cssSelect('div.region-header div.views-field-title')); $this->drupalGet($this->nodes[0]->toUrl()); $result = $this->cssSelect('div.region-header div.views-field-title')[0]->getText(); $this->assertEqual('test title 1', $result); $this->drupalGet($this->nodes[1]->toUrl()); $result = $this->cssSelect('div.region-header div.views-field-title')[0]->getText(); $this->assertEqual('test title 2', $result); $this->drupalGet($this->nodes[0]->toUrl()); $result = $this->cssSelect('div.region-header div.views-field-title')[0]->getText(); $this->assertEqual('test title 1', $result); } }