Skip to content

Commit

Permalink
Don't throw NotUpdatedExceptions in BeforeScenario and AfterScenario …
Browse files Browse the repository at this point in the history
…hooks.
  • Loading branch information
becw committed Aug 9, 2016
1 parent 1de9a79 commit 6177850
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class DrupalAutoNodetitleContext extends SharedDrupalContext
*/
public function disableAutoNodetitle()
{
throw new NotUpdatedException();

$this->disableAutoNodetitle = true;

}//end disableAutoNodetitle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class DrupalCommentContext extends SharedDrupalContext
*/
public function gatherContexts(BeforeScenarioScope $scope)
{
throw new NotUpdatedException();

$environment = $scope->getEnvironment();
$this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext');

Expand All @@ -82,11 +80,14 @@ public function gatherContexts(BeforeScenarioScope $scope)
*/
public function checkDependencies(BeforeScenarioScope $scope)
{
throw new NotUpdatedException();
/*
@todo Update for Drupal 8
@see NotUpdatedException
if (module_exists('comment') === false) {
throw new \Exception('The Comment module is not available.');
}
if (module_exists('comment') === false) {
throw new \Exception('The Comment module is not available.');
}
*/

}//end checkDependencies()

Expand All @@ -100,12 +101,15 @@ public function checkDependencies(BeforeScenarioScope $scope)
*/
public function cleanComments()
{
throw new NotUpdatedException();
/*
@todo Update for Drupal 8
@see NotUpdatedException
// Remove any comments that were created.
foreach ($this->comments as $comment) {
comment_delete($comment->cid);
}
// Remove any comments that were created.
foreach ($this->comments as $comment) {
comment_delete($comment->cid);
}
*/

$this->comments = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class DrupalOrganicGroupsContext extends SharedDrupalContext
*/
public function gatherContexts(BeforeScenarioScope $scope)
{
throw new NotUpdatedException();

$environment = $scope->getEnvironment();
$this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext');

Expand All @@ -65,11 +63,14 @@ public function gatherContexts(BeforeScenarioScope $scope)
*/
public function checkDependencies(BeforeScenarioScope $scope)
{
throw new NotUpdatedException();

if (module_exists('og') === false) {
throw new \Exception('The Organic Groups module is not installed.');
}
/*
@todo Update for Drupal 8
@see NotUpdatedException
if (module_exists('og') === false) {
throw new \Exception('The Organic Groups module is not installed.');
}
*/

}//end checkDependencies()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class DrupalWorkbenchModerationContext extends SharedDrupalContext
*/
public function disableWorkbenchModeration()
{
throw new NotUpdatedException();

$this->disableWorkbenchModeration = true;

}//end disableWorkbenchModeration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,14 @@ public function expandFile($file)
*/
public function cleanFiles()
{
throw new NotUpdatedException();
/*
@todo Update for Drupal 8
@see NotUpdatedException
foreach ($this->files as $file) {
file_delete($file, true);
}
foreach ($this->files as $file) {
file_delete($file, true);
}
*/

$this->files = array();

Expand Down

0 comments on commit 6177850

Please sign in to comment.