X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fdrupal-extension%2Fsrc%2FDrupal%2FDrupalExtension%2FContext%2FDrushContext.php;fp=vendor%2Fdrupal%2Fdrupal-extension%2Fsrc%2FDrupal%2FDrupalExtension%2FContext%2FDrushContext.php;h=0000000000000000000000000000000000000000;hp=3b33c6071e02221f26b695467ca392966f3ca1dd;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/DrushContext.php b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/DrushContext.php deleted file mode 100644 index 3b33c6071..000000000 --- a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/DrushContext.php +++ /dev/null @@ -1,102 +0,0 @@ -drushOutput)) { - throw new \RuntimeException('No drush output was found.'); - } - return $this->drushOutput; - } - - /** - * @Given I run drush :command - */ - public function assertDrushCommand($command) { - if (!$this->drushOutput = $this->getDriver('drush')->$command()) { - $this->drushOutput = TRUE; - } - } - - /** - * @Given I run drush :command :arguments - */ - public function assertDrushCommandWithArgument($command, $arguments) { - $this->drushOutput = $this->getDriver('drush')->$command($this->fixStepArgument($arguments)); - if (!isset($this->drushOutput)) { - $this->drushOutput = TRUE; - } - } - - /** - * @Then drush output should contain :output - */ - public function assertDrushOutput($output) { - if (strpos((string) $this->readDrushOutput(), $this->fixStepArgument($output)) === FALSE) { - throw new \Exception(sprintf("The last drush command output did not contain '%s'.\nInstead, it was:\n\n%s'", $output, $this->drushOutput)); - } - } - - /** - * @Then drush output should match :regex - */ - public function assertDrushOutputMatches($regex) { - if (!preg_match($regex, (string) $this->readDrushOutput())) { - throw new \Exception(sprintf("The pattern %s was not found anywhere in the drush output.\nOutput:\n\n%s", $regex, $this->drushOutput)); - } - } - - /** - * @Then drush output should not contain :output - */ - public function drushOutputShouldNotContain($output) { - if (strpos((string) $this->readDrushOutput(), $this->fixStepArgument($output)) !== FALSE) { - throw new \Exception(sprintf("The last drush command output did contain '%s' although it should not.\nOutput:\n\n%s'", $output, $this->drushOutput)); - } - } - - /** - * @Then print last drush output - */ - public function printLastDrushOutput() { - echo $this->readDrushOutput(); - } - - /** - * Returns fixed step argument (with \\" replaced back to "). - * - * @param string $argument - * - * @return string - */ - protected function fixStepArgument($argument) { - return str_replace('\\"', '"', $argument); - } - -}