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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?