From e6299d9a5fa034761e880a041d98fa26fd365830 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Tue, 15 Jan 2019 14:54:47 +0000 Subject: [PATCH] MDL-63977 Behat: Add generic way to get tag list --- behat_app.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/behat_app.php b/behat_app.php index f5d723dd2..a211dcef9 100644 --- a/behat_app.php +++ b/behat_app.php @@ -29,7 +29,6 @@ require_once(__DIR__ . '/../../behat/behat_base.php'); use Behat\Mink\Exception\DriverException; use Behat\Mink\Exception\ExpectationException; -use Behat\Behat\Hook\Scope\BeforeScenarioScope; /** * Mobile/desktop app steps definitions. @@ -40,9 +39,6 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class behat_app extends behat_base { - /** @var bool True if the current scenario has the app tag */ - protected $apptag = false; - /** @var stdClass Object with data about launched Ionic instance (if any) */ protected static $ionicrunning = null; @@ -55,17 +51,6 @@ class behat_app extends behat_base { return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; } - /** - * Checks tags before each scenario. - * - * @BeforeScenario - * @param BeforeScenarioScope $scope Scope information - */ - public function check_tags(BeforeScenarioScope $scope) { - $this->apptag = in_array('app', $scope->getScenario()->getTags()) || - in_array('app', $scope->getFeature()->getTags()); - } - /** * Opens the Moodle app in the browser. * @@ -101,7 +86,7 @@ class behat_app extends behat_base { global $CFG; // Check the app tag was set. - if (!$this->apptag) { + if (!$this->has_tag('app')) { throw new DriverException('Requires @app tag on scenario or feature.'); }