ContentOverviewTest.php in Lightning Core 8.5
File
modules/lightning_roles/tests/src/Functional/ContentOverviewTest.php
View source
<?php
namespace Drupal\Tests\lightning_roles\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
class ContentOverviewTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'lightning_roles',
'node',
];
public function test() {
$node_type = $this
->createContentType()
->id();
$role = Role::load($node_type . '_reviewer');
$this
->assertInstanceOf(Role::class, $role);
$account = $this
->createUser();
$account
->addRole($role
->id());
$account
->save();
$this
->drupalLogin($account);
$this
->drupalGet('/admin/content');
$this
->assertSession()
->statusCodeEquals(200);
}
}