Skip to content

Commit

Permalink
Merge pull request #174 from webflo/keep-state
Browse files Browse the repository at this point in the history
Keep state in RawDrupalContext

Signed-off-by: Jonathan Hedstrom <[email protected]>
  • Loading branch information
jhedstrom committed Jun 1, 2015
1 parent 613570f commit 8c7d7e6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
27 changes: 27 additions & 0 deletions features/api_background.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@d6 @d7 @d8 @api
Feature: DrupalContext
Test DrupalContext in combination with Backgrounds

Background:
Given "tags" terms:
| name |
| Tag one |
| Tag two |

Given users:
| name |
| User one |
| User two |

Given "article" content:
| title |
| Node one |
| Node two |

Scenario Outline:
Given I am not logged in

Examples:
| user |
| foo |
| bar |
4 changes: 4 additions & 0 deletions src/Drupal/DrupalExtension/Context/RawDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public function cleanNodes() {
foreach ($this->nodes as $node) {
$this->getDriver()->nodeDelete($node);
}
$this->nodes = array();
}

/**
Expand All @@ -174,6 +175,7 @@ public function cleanUsers() {
$this->getDriver()->userDelete($user);
}
$this->getDriver()->processBatch();
$this->users = array();
}
}

Expand All @@ -187,6 +189,7 @@ public function cleanTerms() {
foreach ($this->terms as $term) {
$this->getDriver()->termDelete($term);
}
$this->terms = array();
}

/**
Expand All @@ -199,6 +202,7 @@ public function cleanRoles() {
foreach ($this->roles as $rid) {
$this->getDriver()->roleDelete($rid);
}
$this->roles = array();
}

/**
Expand Down

0 comments on commit 8c7d7e6

Please sign in to comment.