You are here

protected function RESTTestBase::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Tests/RESTTestBase.php \Drupal\rest\Tests\RESTTestBase::setUp()

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

5 calls to RESTTestBase::setUp()
CreateTest::setUp in core/modules/rest/src/Tests/CreateTest.php
Sets up a Drupal site for running functional and integration tests.
CsrfTest::setUp in core/modules/rest/src/Tests/CsrfTest.php
Sets up a Drupal site for running functional and integration tests.
DbLogResourceTest::setUp in core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php
Sets up a Drupal site for running functional and integration tests.
ResourceTest::setUp in core/modules/rest/src/Tests/ResourceTest.php
Sets up a Drupal site for running functional and integration tests.
ResponseGeneratorTest::setUp in core/modules/system/src/Tests/System/ResponseGeneratorTest.php
Sets up a Drupal site for running functional and integration tests.
5 methods override RESTTestBase::setUp()
CreateTest::setUp in core/modules/rest/src/Tests/CreateTest.php
Sets up a Drupal site for running functional and integration tests.
CsrfTest::setUp in core/modules/rest/src/Tests/CsrfTest.php
Sets up a Drupal site for running functional and integration tests.
DbLogResourceTest::setUp in core/modules/dblog/src/Tests/Rest/DbLogResourceTest.php
Sets up a Drupal site for running functional and integration tests.
ResourceTest::setUp in core/modules/rest/src/Tests/ResourceTest.php
Sets up a Drupal site for running functional and integration tests.
ResponseGeneratorTest::setUp in core/modules/system/src/Tests/System/ResponseGeneratorTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/rest/src/Tests/RESTTestBase.php, line 61
Contains \Drupal\rest\Tests\RESTTestBase.

Class

RESTTestBase
Test helper class that provides a REST client method to send HTTP requests.

Namespace

Drupal\rest\Tests

Code

protected function setUp() {
  parent::setUp();
  $this->defaultFormat = 'hal_json';
  $this->defaultMimeType = 'application/hal+json';
  $this->defaultAuth = array(
    'cookie',
  );

  // Create a test content type for node testing.
  $this
    ->drupalCreateContentType(array(
    'name' => 'resttest',
    'type' => 'resttest',
  ));
}