Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via composer

behat/mink v1.10.0

Browser controller/emulator abstraction for PHP
Package summary
Share
0
issues
1
license
2
MIT
Package created
21 Dec 2011
Version published
28 Mar 2022
Maintainers
2
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
behat/mink@v1.10.0
symfony/css-selector@v6.4.7
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of behat/mink 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
symfony/css-selectorv6.4.7-MIT
prod

Visualizations

Frequently Asked Questions

What does behat/mink do?

Behat/Mink is an incredible PHP package that has been designed to act as a browser emulator and a browser controller abstraction. Its unique purpose is to bring an API to the table that would enable developers to systematically and declaratively control and test web application scenarios. This special package would essentially behave as a mediator between your test codes and the native browser driver or emulator of your choice.

How do you use behat/mink?

To utilize Behat/Mink, start by initializing Mink and registering sessions. You then set the desired default session name. To visit a page, use the 'visit' function for the specific session (getSession). You can also interact with page elements like links or buttons. You can select sessions by their names, enabling the capability of mixing sessions in your tests.

Here is a basic 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';

// Initialize 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);

// Interact with the page
$mink->getSession()->getPage()->findLink('Downloads')->click();
echo $mink->getSession()->getPage()->getContent();

// Use a named session
$mink->getSession('custom')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('custom')->getPage()->getContent();

// Mix sessions
$mink->getSession('goutte1')->getPage()->findLink('Chat')->click();
$mink->getSession('goutte2')->getPage()->findLink('Chat')->click();

Dependencies for Behat/Mink are installed using Composer:

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

Where are the behat/mink docs?

All the in-depth information and documentation you might need about behat/mink can be found on Mink's main website https://mink.behat.org. For a community of users and contributors, you can engage with official Google Group https://groups.google.com/group/behat. Further resources such as Notes on Patches/Pull Requests can be found in the repository itself under the filename "CONTRIBUTING.md".