protected function NameAutocompleteTest::setUp in Log entity 2.x
Overrides EntityKernelTestBase::setUp
File
- tests/
src/ Kernel/ NameAutocompleteTest.php, line 75
Class
- NameAutocompleteTest
- Tests name autocomplete for logs.
Namespace
Drupal\Tests\log\KernelCode
protected function setUp() {
parent::setUp();
$this
->installEntitySchema('log');
$this
->installConfig([
'log',
'log_test',
]);
// Create the test user accounts.
$this->adminAccount = $this
->createUser([], [
'administer log',
]);
$this->anyAccount = $this
->createUser([], [
'view any default log',
'create default log',
]);
$this->ownAccount = $this
->createUser([], [
'view own default log',
'create default log',
]);
$this->noneAccount = $this
->createUser([], [
'create default log',
]);
// Create the different log entries.
$this->logs[] = $this
->createLogEntity([
'name' => 'First log',
'uid' => $this->adminAccount
->id(),
]);
$this->logs[] = $this
->createLogEntity([
'name' => 'Second log',
'uid' => $this->adminAccount
->id(),
]);
$this->logs[] = $this
->createLogEntity([
'name' => 'Third log',
'uid' => $this->ownAccount
->id(),
]);
}