Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
renamed match to pattern to make step regex more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed May 2, 2011
1 parent 01b7215 commit 829276a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Behat/Mink/Integration/steps/mink_steps.php
Expand Up @@ -112,12 +112,12 @@
);
});

$steps->Then('/^the url should match (?P<match>.+)$/', function($world, $match) {
if (preg_match('/^\/.*\/$', $match)) {
assertRegExp($match, parse_url($world->getSession()->getCurrentUrl(), PHP_URL_PATH));
$steps->Then('/^the url should match (?P<pattern>.+)$/', function($world, $pattern) {
if (preg_match('/^\/.*\/$', $pattern)) {
assertRegExp($pattern, parse_url($world->getSession()->getCurrentUrl(), PHP_URL_PATH));
} else {
assertRegExp(
'/'.preg_quote($match, '/').'/',
'/'.preg_quote($pattern, '/').'/',
parse_url($world->getSession()->getCurrentUrl(), PHP_URL_PATH)
);
}
Expand Down

0 comments on commit 829276a

Please sign in to comment.