Mink travis-ci Packagist phpunit

PHP 5.3+ web browser emulator abstraction

3 years after

Mink

Latest Stable Version Latest Unstable Version Total Downloads Scrutinizer Quality Score Code Coverage Build Status SensioLabsInsight License

Useful Links

Usage Example

<?php

use Behat\Mink\Mink,
    Behat\Mink\Session,
    Behat\Mink\Driver\GoutteDriver,
    Behat\Mink\Driver\Goutte\Client as GoutteClient;

$startUrl = 'http://example.com';

// init Mink and register sessions
$mink = new Mink(array(
    'goutte1' => new Session(new GoutteDriver(new GoutteClient())),
    'goutte2' => new Session(new GoutteDriver(new GoutteClient())),
    'custom'  => new Session(new MyCustomDriver($startUrl))
));

// set the default session name
$mink->setDefaultSessionName('goutte2');

// visit a page
$mink->getSession()->visit($startUrl);

// call to getSession() without argument will always return a default session if has one (goutte2 here)
$mink->getSession()->getPage()->findLink('Downloads')->click();
echo $mink->getSession()->getPage()->getContent();

// call to getSession() with argument will return session by its name
$mink->getSession('custom')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('custom')->getPage()->getContent();

// this all is done to make possible mixing sessions
$mink->getSession('goutte1')->getPage()->findLink('Chat')->click();
$mink->getSession('goutte2')->getPage()->findLink('Chat')->click();

Install Dependencies

$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar install

Contributors

Related Repositories

phpunit-mink

phpunit-mink

Library for using Mink in PHPUnit tests. Supports session sharing between tests ...

magento-mink

magento-mink

Test your Magento website with Behat Mink. ...

behat-mink-browserstack

behat-mink-browserstack

A feature context which sets up Mink for Browserstack ...

Behat-Mink-TestingBot

Behat-Mink-TestingBot

Behat, Mink and TestingBot ...

mink-page-objects

mink-page-objects

Implementation of Page Objects Pattern for Mink ...


Top Contributors

everzet stof aik099 alexandresalome b00giZm handrus schmittjoh zombor xmeltrut robsquires raspberryman gimler robocoder benja-M-1 grahambates jdreesen mdhooge proofek docteurklein hidenorigoto radepal asm89 neochief anbotero robo47 clemherreman djacquel ThePixelDeveloper pgodel pete-otaqui

Releases

-   v1.6.0 zip tar
-   v1.5.0 zip tar
-   v1.4.3 zip tar
-   v1.4.2 zip tar
-   v1.4.1 zip tar
-   v1.4.0 zip tar
-   v1.4.0beta5 zip tar
-   v1.4.0beta4 zip tar
-   v1.4.0beta3 zip tar
-   v1.4.0beta2 zip tar
-   v1.4.0beta1 zip tar
-   v1.3.4 zip tar
-   v1.3.3 zip tar
-   v1.3.2 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.0 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar
-   v1.0.4 zip tar
-   v1.0.3 zip tar
-   v1.0.2 zip tar
-   v1.0.1 zip tar
-   v1.0.0 zip tar
-   v0.3.2 zip tar
-   v0.3.1 zip tar
-   v0.3.0 zip tar
-   v0.2.4 zip tar
-   v0.2.3 zip tar
-   v0.2.2 zip tar