protected function SubPathautoKernelTest::setUp in Sub-pathauto (Sub-path URL Aliases) 8
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ SubPathautoKernelTest.php, line 41
Class
- SubPathautoKernelTest
- @coversDefaultClass \Drupal\subpathauto\PathProcessor @group subpathauto
Namespace
Drupal\Tests\subpathauto\KernelCode
protected function setUp() {
parent::setUp();
$this
->installSchema('system', 'sequences');
$this
->installEntitySchema('user');
$this
->installEntitySchema('node');
$this
->installEntitySchema('path_alias');
$this
->installConfig('subpathauto');
// Create the node bundles required for testing.
$type = NodeType::create([
'type' => 'page',
'name' => 'page',
]);
$type
->save();
$this->pathProcessor = $this->container
->get('path_processor_subpathauto');
$aliasWhiteList = $this->container
->get('path_alias.whitelist');
Node::create([
'type' => 'page',
'title' => 'test',
])
->save();
$aliasStorage = \Drupal::entityTypeManager()
->getStorage('path_alias');
$path_alias = $aliasStorage
->create([
'path' => '/node/1',
'alias' => '/kittens',
]);
$path_alias
->save();
$aliasWhiteList
->set('node', TRUE);
User::create([
'uid' => 0,
'name' => 'anonymous user',
])
->save();
}