You are here

class PostContext in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  2. 8.4 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  3. 8.5 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  4. 8.6 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  5. 8.7 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  6. 8.8 tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  7. 10.3.x tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  8. 10.0.x tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  9. 10.1.x tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext
  10. 10.2.x tests/behat/features/bootstrap/PostContext.php \Drupal\social\Behat\PostContext

Defines application features from the specific context.

Hierarchy

  • class \Drupal\social\Behat\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'
behat.yml in tests/behat/config/behat.yml
tests/behat/config/behat.yml

File

tests/behat/features/bootstrap/PostContext.php, line 20

Namespace

Drupal\social\Behat
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

Namesort descending Modifiers Type Description Overrides
PostContext::cleanupPost public function @AfterScenario @database&&@post