Introduce RawMinkContext::visitPath() helper method

This commit is contained in:
everzet
2014-09-23 11:59:27 +01:00
parent 5e54daa786
commit 06a4cb5661
2 changed files with 13 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ class MinkContext extends RawMinkContext implements TranslatableContext
*/ */
public function iAmOnHomepage() public function iAmOnHomepage()
{ {
$this->getSession()->visit($this->locatePath('/')); $this->visitPath('/');
} }
/** /**
@@ -40,7 +40,7 @@ class MinkContext extends RawMinkContext implements TranslatableContext
*/ */
public function visit($page) public function visit($page)
{ {
$this->getSession()->visit($this->locatePath($page)); $this->visitPath($page);
} }
/** /**

View File

@@ -113,6 +113,17 @@ class RawMinkContext implements MinkAwareContext
return $this->getMink()->assertSession($name); 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. * Locates url, based on provided path.
* Override to provide custom routing mechanism. * Override to provide custom routing mechanism.