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