You are here

protected function IntegrationTest::setUp in Search API Saved Searches 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/IntegrationTest.php, line 64

Class

IntegrationTest
Tests overall functionality of the module.

Namespace

Drupal\Tests\search_api_saved_searches\Functional

Code

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

  // Create test users.
  $this->adminUser = $this
    ->createUser([
    SavedSearchAccessControlHandler::ADMIN_PERMISSION,
    'administer search_api_saved_search display',
    'administer search_api_saved_search fields',
    'administer search_api_saved_search form display',
  ]);
  $this->registeredUser = $this
    ->createUser();
  $this->registeredUser2 = $this
    ->createUser();

  // Use the state system collector mail backend.
  $this
    ->config('system.mail')
    ->set('interface.default', 'test_mail_collector')
    ->save();

  // Report all log messages as errors.
  $logger = new TestLogger('');
  $this->container
    ->set('logger.factory', $logger);
  $this->container
    ->set('logger.channel.search_api_saved_searches', $logger);

  // Generate and index example content.
  $this
    ->setUpExampleStructure();
  $this
    ->insertExampleContent();
  $this
    ->indexItems('database_search_index');

  // Make normal admin UI navigation possible by enabling some common blocks.
  $this
    ->placeBlock('local_actions_block');
  $this
    ->placeBlock('local_tasks_block');
}