From 9ccbc8c412ebb0f97589c8de85a04fd9402500a2 Mon Sep 17 00:00:00 2001 From: Bec White Date: Tue, 9 Aug 2016 17:15:42 -0500 Subject: [PATCH] Don't throw NotUpdatedExceptions in BeforeScenario and AfterScenario hooks. --- .../Context/DrupalAutoNodetitleContext.php | 2 -- .../Context/DrupalCommentContext.php | 20 +++++++++---------- .../Context/DrupalOrganicGroupsContext.php | 11 +++++----- .../DrupalWorkbenchModerationContext.php | 2 -- .../Context/SharedDrupalContext.php | 9 +++++---- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php index c38c5ed..173c149 100644 --- a/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalAutoNodetitleContext.php @@ -38,8 +38,6 @@ class DrupalAutoNodetitleContext extends SharedDrupalContext */ public function disableAutoNodetitle() { - throw new NotUpdatedException(); - $this->disableAutoNodetitle = true; }//end disableAutoNodetitle() diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalCommentContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalCommentContext.php index 5dc474b..e9cd8dc 100644 --- a/src/Palantirnet/PalantirBehatExtension/Context/DrupalCommentContext.php +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalCommentContext.php @@ -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'); @@ -82,11 +80,12 @@ public function gatherContexts(BeforeScenarioScope $scope) */ public function checkDependencies(BeforeScenarioScope $scope) { - throw new NotUpdatedException(); + //throw new NotUpdatedException(); + // @todo Update for Drupal 8 - 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() @@ -100,12 +99,13 @@ public function checkDependencies(BeforeScenarioScope $scope) */ public function cleanComments() { - throw new NotUpdatedException(); + //throw new NotUpdatedException(); + // @todo Update for Drupal 8 // Remove any comments that were created. - foreach ($this->comments as $comment) { - comment_delete($comment->cid); - } + //foreach ($this->comments as $comment) { + // comment_delete($comment->cid); + //} $this->comments = array(); diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalOrganicGroupsContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalOrganicGroupsContext.php index 2e4ae11..c1381da 100644 --- a/src/Palantirnet/PalantirBehatExtension/Context/DrupalOrganicGroupsContext.php +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalOrganicGroupsContext.php @@ -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'); @@ -65,11 +63,12 @@ public function gatherContexts(BeforeScenarioScope $scope) */ public function checkDependencies(BeforeScenarioScope $scope) { - throw new NotUpdatedException(); + //throw new NotUpdatedException(); + // @todo Update for Drupal 8 - if (module_exists('og') === false) { - throw new \Exception('The Organic Groups module is not installed.'); - } + //if (module_exists('og') === false) { + // throw new \Exception('The Organic Groups module is not installed.'); + //} }//end checkDependencies() diff --git a/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php b/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php index 36ff72e..e4b6ff5 100644 --- a/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php +++ b/src/Palantirnet/PalantirBehatExtension/Context/DrupalWorkbenchModerationContext.php @@ -37,8 +37,6 @@ class DrupalWorkbenchModerationContext extends SharedDrupalContext */ public function disableWorkbenchModeration() { - throw new NotUpdatedException(); - $this->disableWorkbenchModeration = true; }//end disableWorkbenchModeration() diff --git a/src/Palantirnet/PalantirBehatExtension/Context/SharedDrupalContext.php b/src/Palantirnet/PalantirBehatExtension/Context/SharedDrupalContext.php index a814b13..7a1c45b 100644 --- a/src/Palantirnet/PalantirBehatExtension/Context/SharedDrupalContext.php +++ b/src/Palantirnet/PalantirBehatExtension/Context/SharedDrupalContext.php @@ -246,11 +246,12 @@ public function expandFile($file) */ public function cleanFiles() { - throw new NotUpdatedException(); + //throw new NotUpdatedException(); + // @todo Update for Drupal 8 - foreach ($this->files as $file) { - file_delete($file, true); - } + //foreach ($this->files as $file) { + // file_delete($file, true); + //} $this->files = array();