You are here

protected function SiteMapTestBase::setUp in Site map 8

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides TaxonomyTestBase::setUp

2 calls to SiteMapTestBase::setUp()
SiteMapCategoriesTest::setUp in src/Tests/SiteMapCategoriesTest.php
Sets up a Drupal site for running functional and integration tests.
SiteMapRssTest::setUp in src/Tests/SiteMapRssTest.php
Sets up a Drupal site for running functional and integration tests.
2 methods override SiteMapTestBase::setUp()
SiteMapCategoriesTest::setUp in src/Tests/SiteMapCategoriesTest.php
Sets up a Drupal site for running functional and integration tests.
SiteMapRssTest::setUp in src/Tests/SiteMapRssTest.php
Sets up a Drupal site for running functional and integration tests.

File

src/Tests/SiteMapTestBase.php, line 24

Class

SiteMapTestBase
Base class for Site Map test cases.

Namespace

Drupal\site_map\Tests

Code

protected function setUp() {
  parent::setUp();

  // Create filter format.
  $restricted_html_format = entity_create('filter_format', array(
    'format' => 'restricted_html',
    'name' => 'Restricted HTML',
    'filters' => array(
      'filter_html' => array(
        'status' => TRUE,
        'weight' => -10,
        'settings' => array(
          'allowed_html' => '<p> <br /> <strong> <a> <em> <h4>',
        ),
      ),
      'filter_autop' => array(
        'status' => TRUE,
        'weight' => 0,
      ),
      'filter_url' => array(
        'status' => TRUE,
        'weight' => 0,
      ),
      'filter_htmlcorrector' => array(
        'status' => TRUE,
        'weight' => 10,
      ),
    ),
  ));
  $restricted_html_format
    ->save();

  // Create user then login.
  $this->user = $this
    ->drupalCreateUser(array(
    'administer site configuration',
    'access site map',
    'administer menu',
    'administer nodes',
    'create article content',
    'administer taxonomy',
    $restricted_html_format
      ->getPermissionName(),
  ));
  $this
    ->drupalLogin($this->user);
}