You are here

public function SimplenewsTestBase::setUp in Simplenews 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 WebTestBase::setUp

8 calls to SimplenewsTestBase::setUp()
SimplenewsAdministrationTest::setUp in src/Tests/SimplenewsAdministrationTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsFieldUiTest::setUp in src/Tests/SimplenewsFieldUiTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsI18nTest::setUp in src/Tests/SimplenewsI18nTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsPersonalizationFormsTest::setUp in src/Tests/SimplenewsPersonalizationFormsTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsSendTest::setUp in src/Tests/SimplenewsSendTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

8 methods override SimplenewsTestBase::setUp()
SimplenewsAdministrationTest::setUp in src/Tests/SimplenewsAdministrationTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsFieldUiTest::setUp in src/Tests/SimplenewsFieldUiTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsI18nTest::setUp in src/Tests/SimplenewsI18nTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsPersonalizationFormsTest::setUp in src/Tests/SimplenewsPersonalizationFormsTest.php
Sets up a Drupal site for running functional and integration tests.
SimplenewsSendTest::setUp in src/Tests/SimplenewsSendTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

File

src/Tests/SimplenewsTestBase.php, line 38
Simplenews test functions.

Class

SimplenewsTestBase
Base class for simplenews web tests.

Namespace

Drupal\simplenews\Tests

Code

public function setUp() {
  parent::setUp();
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $this
    ->drupalPlaceBlock('local_actions_block');
  $this
    ->drupalPlaceBlock('page_title_block');
  $this->config = $this
    ->config('simplenews.settings');
  $site_config = $this
    ->config('system.site');
  $site_config
    ->set('site_mail', 'simpletest@example.com');

  // The default newsletter has already been created, so we need to make sure
  // that the defaut newsletter has a valid from address.
  $newsletter = Newsletter::load('default');
  $newsletter->from_address = $site_config
    ->get('site_mail');
  $newsletter
    ->save();
}