class PostContext in Open Social 8.2
Same name and namespace in other branches
- 8 tests/behat/features/bootstrap/PostContext.php \PostContext
Defines application features from the specific context.
Hierarchy
- class \PostContext extends \Drupal\DrupalExtension\Context\RawDrupalContext implements \Behat\Behat\Context\Context, \Behat\Behat\Context\SnippetAcceptingContext
Expanded class hierarchy of PostContext
1 string reference to 'PostContext'
File
- tests/
behat/ features/ bootstrap/ PostContext.php, line 18
View source
class PostContext extends RawDrupalContext implements Context, SnippetAcceptingContext {
/**
* @AfterScenario @database&&@post
*/
public function cleanupPost(AfterScenarioScope $scope) {
$query = \Drupal::entityQuery('post')
->condition('field_post', array(
'This is a public post.',
'This is a community post.',
), 'IN');
$post_ids = $query
->execute();
$posts = entity_load_multiple('post', $post_ids);
foreach ($posts as $post) {
$post
->delete();
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PostContext:: |
public | function | @AfterScenario @database&&@post |