ExtraFieldDisplayFieldTest.php in Extra Field 8.2
File
tests/src/Functional/ExtraFieldDisplayFieldTest.php
View source
<?php
namespace Drupal\Tests\extra_field\Functional;
class ExtraFieldDisplayFieldTest extends ExtraFieldBrowserTestBase {
public static $modules = [
'extra_field',
'extra_field_test',
'node',
];
protected $firstNode;
protected $secondNode;
protected function setUp() {
parent::setUp();
$this->firstNode = $this
->createContent('first_node_type');
$this->secondNode = $this
->createContent('another_node_type');
}
public function testFirstNodeTypeFields() {
$url = $this->firstNode
->toUrl();
$this
->drupalGet($url);
$this
->assertSession()
->pageTextContains('Output from SingleTextFieldTest');
$this
->assertSession()
->pageTextContains('Single text');
$this
->assertSession()
->pageTextContains('Aap');
$this
->assertSession()
->pageTextContains('Noot');
$this
->assertSession()
->pageTextContains('Zus');
$this
->assertSession()
->pageTextContains('Related pages');
$this
->assertSession()
->pageTextContains($this->secondNode
->label());
$this
->assertCacheTag('node:' . $this->secondNode
->id());
$this
->assertSession()
->pageTextNotContains('Empty field');
}
}