This repository was archived by the owner on Mar 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/Behat/MinkExtension/Context Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments