From 541b1462de84b5ea3f65918b479b7cf740972d97 Mon Sep 17 00:00:00 2001 From: dantleech Date: Tue, 2 Dec 2014 12:51:45 +0100 Subject: [PATCH] Throw exception if mink has not been set in context --- src/Behat/MinkExtension/Context/RawMinkContext.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Behat/MinkExtension/Context/RawMinkContext.php b/src/Behat/MinkExtension/Context/RawMinkContext.php index e7c1726..d07610e 100644 --- a/src/Behat/MinkExtension/Context/RawMinkContext.php +++ b/src/Behat/MinkExtension/Context/RawMinkContext.php @@ -42,6 +42,13 @@ class RawMinkContext implements MinkAwareContext */ public function getMink() { + if (null === $this->mink) { + throw new \RuntimeException( + 'Mink instance has not been set on Mink context class. ' . + 'Have you enabled the Mink Extension?' + ); + } + return $this->mink; }