protected function SimplenewsDemoTest::setUp in Simplenews 3.x
Same name and namespace in other branches
- 8.2 modules/simplenews_demo/tests/src/Functional/SimplenewsDemoTest.php \Drupal\Tests\simplenews_demo\Functional\SimplenewsDemoTest::setUp()
Overrides BrowserTestBase::setUp
File
- modules/
simplenews_demo/ tests/ src/ Functional/ SimplenewsDemoTest.php, line 29
Class
- SimplenewsDemoTest
- Tests the demo module for Simplenews.
Namespace
Drupal\Tests\simplenews_demo\FunctionalCode
protected function setUp() {
parent::setUp();
// Install bartik theme.
\Drupal::service('theme_installer')
->install([
'bartik',
]);
$theme_settings = $this
->config('system.theme');
$theme_settings
->set('default', 'bartik')
->save();
// Install simplenews_demo module.
\Drupal::service('module_installer')
->install([
'simplenews_demo',
]);
// Log in with all relevant permissions.
$this
->drupalLogin($this
->drupalCreateUser([
'administer simplenews subscriptions',
'send newsletter',
'administer newsletters',
'administer simplenews settings',
]));
}