You are here

public function PbfAccessByUserDirectTest::setUp in Permissions by field 8

Setup and create content whith Pbf field.

Overrides PbfBaseTest::setUp

File

tests/src/Functional/PbfAccessByUserDirectTest.php, line 29

Class

PbfAccessByUserDirectTest
Test access permissions with Pbf field which reference user directly.

Namespace

Drupal\Tests\pbf\Functional

Code

public function setUp() {
  parent::setUp();
  $this->fieldname = 'field_pbf_user';
  $this->userMethod = 'user';
  $this
    ->attachPbfUserFields($this->fieldname, $this->userMethod);
  $this->user = $this
    ->drupalCreateUser($this->permissions);
  $this->article1 = $this
    ->createSimpleArticle('Article 1', $this->fieldname, $this->user
    ->id(), 1, 0, 0, 0);
  $this->article2 = $this
    ->createSimpleArticle('Article 2', $this->fieldname, $this->user
    ->id(), 0, 1, 0, 0);
}