Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Introduce RawMinkContext::visitPath() helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed Sep 23, 2014
1 parent 5e54daa commit 06a4cb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Behat/MinkExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MinkContext extends RawMinkContext implements TranslatableContext
*/
public function iAmOnHomepage()
{
$this->getSession()->visit($this->locatePath('/'));
$this->visitPath('/');
}

/**
Expand All @@ -40,7 +40,7 @@ public function iAmOnHomepage()
*/
public function visit($page)
{
$this->getSession()->visit($this->locatePath($page));
$this->visitPath($page);
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/Behat/MinkExtension/Context/RawMinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ public function assertSession($name = null)
return $this->getMink()->assertSession($name);
}

/**
* Visits provided relative path using provided or default session.
*
* @param string $path
* @param string|null $sessionName
*/
public function visitPath($path, $sessionName = null)
{
$this->getSession($sessionName)->visit($this->locatePath($path));
}

/**
* Locates url, based on provided path.
* Override to provide custom routing mechanism.
Expand Down

0 comments on commit 06a4cb5

Please sign in to comment.