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

Commit

Permalink
fixed url-should-match step behavior to match only full string
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed May 2, 2011
1 parent 539fcde commit dc6cf67
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Behat/Mink/Integration/steps/mink_steps.php
Expand Up @@ -112,14 +112,11 @@
);
});

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

Expand Down

0 comments on commit dc6cf67

Please sign in to comment.