Last active
August 29, 2015 14:07
-
-
Save wouterj/66b45c009fdea6b01a9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "require": { | |
| "behat/mink-goutte-driver": "~1.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- this page is http://localhost/some/form.php --> | |
| <!doctype html> | |
| <base href="http://localhost/"> | |
| <?php | |
| if ($_SERVER['REQUEST_METHOD'] === 'POST') { | |
| echo 'Whoa!'; | |
| } | |
| ?> | |
| <form action="#" method="POST"> | |
| <input type="submit" value="submit"> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require 'vendor/autoload.php'; | |
| use Behat\Mink\Mink, | |
| Behat\Mink\Session, | |
| Behat\Mink\Driver\GoutteDriver, | |
| Behat\Mink\Driver\Goutte\Client as GoutteClient; | |
| $mink = new Mink(array( | |
| 'goutte' => new Session(new GoutteDriver(new GoutteClient())), | |
| )); | |
| $session = $mink->getSession('goutte'); | |
| $session->visit('http://localhost/some/form.phtml'); | |
| $btn = $session->getPage()->findButton('submit'); | |
| $btn->click(); | |
| echo $session->getCurrentUrl(); // 'http://localhost#' should be 'http://localhost/some/form.phtml#' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment