You are here

protected function SimplenewsTestBase::setUp in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/SimplenewsTestBase.php \Drupal\Tests\simplenews\Functional\SimplenewsTestBase::setUp()

Overrides BrowserTestBase::setUp

9 calls to SimplenewsTestBase::setUp()
SimplenewsAdministrationTest::setUp in tests/src/Functional/SimplenewsAdministrationTest.php
SimplenewsFieldUiTest::setUp in tests/src/Functional/SimplenewsFieldUiTest.php
SimplenewsI18nTest::setUp in tests/src/Functional/SimplenewsI18nTest.php
SimplenewsPersonalizationFormsTest::setUp in tests/src/Functional/SimplenewsPersonalizationFormsTest.php
SimplenewsRecipientHandlerTest::setUp in tests/src/Functional/SimplenewsRecipientHandlerTest.php

... See full list

9 methods override SimplenewsTestBase::setUp()
SimplenewsAdministrationTest::setUp in tests/src/Functional/SimplenewsAdministrationTest.php
SimplenewsFieldUiTest::setUp in tests/src/Functional/SimplenewsFieldUiTest.php
SimplenewsI18nTest::setUp in tests/src/Functional/SimplenewsI18nTest.php
SimplenewsPersonalizationFormsTest::setUp in tests/src/Functional/SimplenewsPersonalizationFormsTest.php
SimplenewsRecipientHandlerTest::setUp in tests/src/Functional/SimplenewsRecipientHandlerTest.php

... See full list

File

tests/src/Functional/SimplenewsTestBase.php, line 44

Class

SimplenewsTestBase
Base class for simplenews web tests.

Namespace

Drupal\Tests\simplenews\Functional

Code

protected 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();
}