You are here

public function FeedsWebTestBase::setUp in Feeds 8.2

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

7 calls to FeedsWebTestBase::setUp()
CommonSyndicationParserTest::setUp in lib/Drupal/feeds/Tests/CommonSyndicationParserTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperDateMultipleTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperDateMultipleTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperDateTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperDateTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperTaxonomyTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperTaxonomyTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsProcessorTaxonomyTermTest::setUp in lib/Drupal/feeds/Tests/FeedsProcessorTaxonomyTermTest.php
Set up test.

... See full list

7 methods override FeedsWebTestBase::setUp()
CommonSyndicationParserTest::setUp in lib/Drupal/feeds/Tests/CommonSyndicationParserTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperDateMultipleTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperDateMultipleTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperDateTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperDateTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsMapperTaxonomyTest::setUp in lib/Drupal/feeds/Tests/FeedsMapperTaxonomyTest.php
Sets up a Drupal site for running functional and integration tests.
FeedsProcessorTaxonomyTermTest::setUp in lib/Drupal/feeds/Tests/FeedsProcessorTaxonomyTermTest.php
Set up test.

... See full list

File

lib/Drupal/feeds/Tests/FeedsWebTestBase.php, line 42
Common functionality for all Feeds tests.

Class

FeedsWebTestBase
Test basic Data API functionality.

Namespace

Drupal\feeds\Tests

Code

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

  // Create text format.
  $filtered_html_format = entity_create('filter_format', array(
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
    'weight' => 0,
    'filters' => array(
      // URL filter.
      'filter_url' => array(
        'weight' => 0,
        'status' => 1,
      ),
      // HTML filter.
      'filter_html' => array(
        'weight' => 1,
        'status' => 1,
      ),
      // Line break filter.
      'filter_autop' => array(
        'weight' => 2,
        'status' => 1,
      ),
      // HTML corrector filter.
      'filter_htmlcorrector' => array(
        'weight' => 10,
        'status' => 1,
      ),
    ),
  ));
  $filtered_html_format
    ->save();
  $permissions = array();
  $permissions[] = 'access content';
  $permissions[] = 'administer site configuration';
  $permissions[] = 'administer content types';
  $permissions[] = 'administer nodes';
  $permissions[] = 'bypass node access';
  $permissions[] = 'administer taxonomy';
  $permissions[] = 'administer users';
  $permissions[] = 'administer feeds';
  $permissions[] = 'administer node fields';
  $permissions[] = 'administer node display';

  // Create an admin user and log in.
  $this->admin_user = $this
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($this->admin_user);
  $types = array(
    array(
      'type' => 'page',
      'name' => 'Basic page',
    ),
    array(
      'type' => 'article',
      'name' => 'Article',
    ),
  );
  foreach ($types as $type) {
    $this
      ->drupalCreateContentType($type);
    $edit = array(
      'node_options[status]' => 1,
      'node_options[promote]' => 1,
    );
    $this
      ->drupalPost('admin/structure/types/manage/' . $type['type'], $edit, 'Save content type');
  }
  $display = config('views.view.frontpage')
    ->get('display');
  $display['default']['display_options']['pager']['options']['items_per_page'] = 500;
  config('views.view.frontpage')
    ->set('display', $display)
    ->save();
}