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

Commit 06a4cb5

Browse files
committed
Introduce RawMinkContext::visitPath() helper method
1 parent 5e54daa commit 06a4cb5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/Behat/MinkExtension/Context/MinkContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MinkContext extends RawMinkContext implements TranslatableContext
2929
*/
3030
public function iAmOnHomepage()
3131
{
32-
$this->getSession()->visit($this->locatePath('/'));
32+
$this->visitPath('/');
3333
}
3434

3535
/**
@@ -40,7 +40,7 @@ public function iAmOnHomepage()
4040
*/
4141
public function visit($page)
4242
{
43-
$this->getSession()->visit($this->locatePath($page));
43+
$this->visitPath($page);
4444
}
4545

4646
/**

src/Behat/MinkExtension/Context/RawMinkContext.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ public function assertSession($name = null)
113113
return $this->getMink()->assertSession($name);
114114
}
115115

116+
/**
117+
* Visits provided relative path using provided or default session.
118+
*
119+
* @param string $path
120+
* @param string|null $sessionName
121+
*/
122+
public function visitPath($path, $sessionName = null)
123+
{
124+
$this->getSession($sessionName)->visit($this->locatePath($path));
125+
}
126+
116127
/**
117128
* Locates url, based on provided path.
118129
* Override to provide custom routing mechanism.

0 commit comments

Comments
 (0)