PbfBasicTest.php in Permissions by field 8
File
tests/src/Functional/PbfBasicTest.php
View source
<?php
namespace Drupal\Tests\pbf\Functional;
class PbfBasicTest extends PbfBaseTest {
public function setUp() {
parent::setUp();
$this->article1 = $this
->createSimpleArticle('Article 1');
$this->article2 = $this
->createSimpleArticle('Article 2');
}
public function testPbfBasicAccess() {
$this
->drupalLogin($this->normalUser);
$this
->drupalGet('node/' . $this->article1
->id());
$this
->assertResponse(200);
$this
->assertTitle('Article 1 | Drupal', t('Correct title for article 1 found'));
$this
->drupalGet('node/' . $this->article2
->id());
$this
->assertResponse(200);
$this
->assertTitle('Article 2 | Drupal', t('Correct title for article 2 found'));
$this
->drupalGet('node/' . $this->group1
->id());
$this
->assertResponse(200);
$this
->assertTitle('Group 1 | Drupal', t('Correct title for group 1 found'));
$this
->drupalGet('node/' . $this->group2
->id());
$this
->assertResponse(200);
$this
->assertTitle('Group 2 | Drupal', t('Correct title for group 2 found'));
$this->container
->get('cron')
->run();
$this
->checkSearchResults('Article', 2);
$this
->drupalLogout();
$this
->drupalGet('node/' . $this->article1
->id());
$this
->assertResponse(200);
$this
->drupalGet('node/' . $this->article2
->id());
$this
->assertResponse(200);
}
}