protected function SitemapTaxonomyTestBase::setUp in Sitemap 8.2
Same name and namespace in other branches
- 8 src/Tests/SitemapTaxonomyTestBase.php \Drupal\sitemap\Tests\SitemapTaxonomyTestBase::setUp()
- 2.0.x src/Tests/SitemapTaxonomyTestBase.php \Drupal\sitemap\Tests\SitemapTaxonomyTestBase::setUp()
Overrides BrowserTestBase::setUp
1 call to SitemapTaxonomyTestBase::setUp()
1 method overrides SitemapTaxonomyTestBase::setUp()
File
- src/
Tests/ SitemapTaxonomyTestBase.php, line 59
Class
- SitemapTaxonomyTestBase
- Base class for some Sitemap test cases.
Namespace
Drupal\sitemap\TestsCode
protected function setUp() {
parent::setUp();
// Ensure the Article node type.
if ($this->profile != 'standard') {
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
}
// Create a vocabulary.
$this->vocabulary = $this
->createVocabulary();
// Create user, then login.
$this->user = $this
->drupalCreateUser([
'administer sitemap',
'access sitemap',
'administer nodes',
'create article content',
'administer taxonomy',
]);
$this
->drupalLogin($this->user);
// Configure the sitemap to display the vocabulary.
$vid = $this->vocabulary
->id();
$this
->saveSitemapForm([
"plugins[vocabulary:{$vid}][enabled]" => TRUE,
]);
}