You are here

public function FixtureContext::setUp in Lightning API 8.3

@BeforeScenario

File

tests/src/FixtureContext.php, line 16

Class

FixtureContext
Performs set-up and tear-down tasks before and after each test scenario.

Namespace

Drupal\Tests\lightning_api

Code

public function setUp() {
  $this
    ->config('lightning_api.settings')
    ->set('entity_json', TRUE)
    ->set('bundle_docs', TRUE)
    ->save();

  // If Lightning Core's FixtureContext created the test content type before
  // now, react to it retroactively.
  $node_type = NodeType::load('test');
  if ($node_type) {
    lightning_api_entity_insert($node_type);
  }
  $this->container
    ->get('entity_type.bundle.info')
    ->clearCachedBundles();
}