protected function DeleteHomepageTest::setUp in Prevent homepage deletion 8
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ DeleteHomepageTest.php, line 42
Class
- DeleteHomepageTest
- Tests the functionality of this module.
Namespace
Drupal\Tests\prevent_homepage_deletion\FunctionalCode
protected function setUp() {
parent::setUp();
// Add a content type.
$this->contentType = $this
->createContentType([
'type' => 'page',
]);
// Create a first page (homepage).
$this->page_home = $this
->drupalCreateNode([
'type' => 'page',
]);
// Set page to be homepage.
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/node/' . $this->page_home
->id())
->save(TRUE);
// Create a second page (not homepage).
$this->page_not_home = $this
->drupalCreateNode([
'type' => 'page',
]);
}