Mink

PHP 5.3+ web browser emulator abstraction

Github星跟踪图

Mink

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

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

主要指标

概览
名称与所有者minkphp/Mink
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2011-04-04 16:11:16
推送于2025-02-07 09:31:36
最后一次提交2025-02-07 10:31:36
发布数44
最新版本名称v1.12.0 (发布于 )
第一版名称v0.1.0 (发布于 2011-04-04 19:25:45)
用户参与
星数1.6k
关注者数38
派生数280
提交数1.4k
已启用问题?
问题数402
打开的问题数54
拉请求数293
打开的拉请求数22
关闭的拉请求数153
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?