From c911eef0193032d4ffacdc2747b6cc251a231de2 Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Thu, 21 Mar 2013 20:40:33 -0400 Subject: [PATCH] for consistency, fix these step arguments too --- src/Behat/MinkExtension/Context/MinkContext.php | 10 +++++++--- src/Behat/MinkExtension/Context/MinkDictionary.php | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index 43a529e..3c729dd 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -215,7 +215,7 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface */ public function assertUrlRegExp($pattern) { - $this->assertSession()->addressMatches($pattern); + $this->assertSession()->addressMatches($this->fixStepArgument($pattern)); } /** @@ -365,6 +365,8 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface */ public function assertFieldContains($field, $value) { + $field = $this->fixStepArgument($field); + $value = $this->fixStepArgument($value); $this->assertSession()->fieldValueEquals($field, $value); } @@ -375,6 +377,8 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface */ public function assertFieldNotContains($field, $value) { + $field = $this->fixStepArgument($field); + $value = $this->fixStepArgument($value); $this->assertSession()->fieldValueNotEquals($field, $value); } @@ -386,7 +390,7 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface */ public function assertCheckboxChecked($checkbox) { - $this->assertSession()->checkboxChecked($checkbox); + $this->assertSession()->checkboxChecked($this->fixStepArgument($checkbox)); } /** @@ -398,7 +402,7 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface */ public function assertCheckboxNotChecked($checkbox) { - $this->assertSession()->checkboxNotChecked($checkbox); + $this->assertSession()->checkboxNotChecked($this->fixStepArgument($checkbox)); } /** diff --git a/src/Behat/MinkExtension/Context/MinkDictionary.php b/src/Behat/MinkExtension/Context/MinkDictionary.php index db25931..ebde70f 100644 --- a/src/Behat/MinkExtension/Context/MinkDictionary.php +++ b/src/Behat/MinkExtension/Context/MinkDictionary.php @@ -303,7 +303,7 @@ trait MinkDictionary */ public function assertUrlRegExp($pattern) { - $this->assertSession()->addressMatches($pattern); + $this->assertSession()->addressMatches($this->fixStepArgument($pattern)); } /** @@ -453,6 +453,8 @@ trait MinkDictionary */ public function assertFieldContains($field, $value) { + $field = $this->fixStepArgument($field); + $value = $this->fixStepArgument($value); $this->assertSession()->fieldValueEquals($field, $value); } @@ -463,6 +465,8 @@ trait MinkDictionary */ public function assertFieldNotContains($field, $value) { + $field = $this->fixStepArgument($field); + $value = $this->fixStepArgument($value); $this->assertSession()->fieldValueNotEquals($field, $value); } @@ -474,7 +478,7 @@ trait MinkDictionary */ public function assertCheckboxChecked($checkbox) { - $this->assertSession()->checkboxChecked($checkbox); + $this->assertSession()->checkboxChecked($this->fixStepArgument($checkbox)); } /** @@ -486,7 +490,7 @@ trait MinkDictionary */ public function assertCheckboxNotChecked($checkbox) { - $this->assertSession()->checkboxNotChecked($checkbox); + $this->assertSession()->checkboxNotChecked($this->fixStepArgument($checkbox)); } /**