final class FixtureContext in Lightning API 8.3
Same name and namespace in other branches
- 8.4 tests/src/FixtureContext.php \Drupal\Tests\lightning_api\FixtureContext
Performs set-up and tear-down tasks before and after each test scenario.
Hierarchy
- class \Drupal\Tests\lightning_api\FixtureContext extends \Drupal\Tests\lightning_core\FixtureBase
Expanded class hierarchy of FixtureContext
File
- tests/
src/ FixtureContext.php, line 11
Namespace
Drupal\Tests\lightning_apiView source
final class FixtureContext extends FixtureBase {
/**
* @BeforeScenario
*/
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();
}
/**
* @AfterScenario
*/
public function tearDown() {
// This useless if statement is here to evade a pointless, too-strict coding
// standards check.
if (TRUE) {
parent::tearDown();
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FixtureContext:: |
public | function | @BeforeScenario | |
FixtureContext:: |
public | function | @AfterScenario |