Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176

This commit is contained in:
Pantheon Automation 2015-08-17 17:00:26 -07:00 committed by Greg Anderson
commit 9921556621
13277 changed files with 1459781 additions and 0 deletions

View file

@ -0,0 +1,4 @@
vendor
composer.phar
composer.lock
phpunit.xml

View file

@ -0,0 +1,19 @@
language: php
php: [5.3, 5.4, 5.5, 5.6, hhvm]
before_script:
- export WEB_FIXTURES_HOST=http://localhost
- composer install --dev --prefer-source
- sudo apt-get update
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php5
- sudo sed -i -e "s,/var/www,$(pwd)/vendor/behat/mink/driver-testsuite/web-fixtures,g" /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
script: phpunit -v --coverage-clover=coverage.clover
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

View file

@ -0,0 +1,20 @@
1.1.0 / 2014-10-09
==================
The driver now relies on BrowserKitDriver 1.2.x, so all changes of this driver are relevant.
The changes below only describe the changes related to GoutteDriver specifically.
New features:
* Added the possibility to use a normal Goutte client instead of requiring to use an extended one
* Added the support of Goutte 2.0 as well
Bug fixes:
* Fixed the support of disabling basic auth
* Fixed the resetting of the driver to reset the basic auth
Testing:
* Updated the testsuite to use the new Mink 1.6 driver testsuite
* Added testing on HHVM

View file

@ -0,0 +1,22 @@
Copyright (c) 2012-2013 Konstantin Kudryashov <ever.zet@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,53 @@
Mink Goutte Driver
==================
[![Latest Stable Version](https://poser.pugx.org/behat/mink-goutte-driver/v/stable.svg)](https://packagist.org/packages/behat/mink-goutte-driver)
[![Latest Unstable Version](https://poser.pugx.org/behat/mink-goutte-driver/v/unstable.svg)](https://packagist.org/packages/behat/mink-goutte-driver)
[![Total Downloads](https://poser.pugx.org/behat/mink-goutte-driver/downloads.svg)](https://packagist.org/packages/behat/mink-goutte-driver)
[![Build Status](https://travis-ci.org/Behat/MinkGoutteDriver.svg?branch=master)](https://travis-ci.org/Behat/MinkGoutteDriver)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/badges/quality-score.png?s=ca141bb2cad18e74cf3d3b132b1a6aa0f3f004a5)](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/)
[![Code Coverage](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/badges/coverage.png?s=ca2d17a948660bfaeb4a95bf1a709644305c54f3)](https://scrutinizer-ci.com/g/Behat/MinkGoutteDriver/)
[![License](https://poser.pugx.org/behat/mink-goutte-driver/license.svg)](https://packagist.org/packages/behat/mink-goutte-driver)
Usage Example
-------------
``` php
<?php
use Behat\Mink\Mink,
Behat\Mink\Session,
Behat\Mink\Driver\GoutteDriver,
Behat\Mink\Driver\Goutte\Client as GoutteClient;
$startUrl = 'http://example.com';
$mink = new Mink(array(
'goutte' => new Session(new GoutteDriver(new GoutteClient($startUrl))),
));
$mink->getSession('goutte')->getPage()->findLink('Chat')->click();
```
Installation
------------
``` json
{
"require": {
"behat/mink": "~1.5",
"behat/mink-goutte-driver": "~1.0"
}
}
```
``` bash
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar install
```
Maintainers
-----------
* Konstantin Kudryashov [everzet](http://github.com/everzet)
* Other [awesome developers](https://github.com/Behat/MinkGoutteDriver/graphs/contributors)

View file

@ -0,0 +1,41 @@
{
"name": "behat/mink-goutte-driver",
"description": "Goutte driver for Mink framework",
"keywords": ["goutte", "headless", "testing", "browser"],
"homepage": "http://mink.behat.org/",
"type": "mink-driver",
"license": "MIT",
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"require": {
"php": ">=5.3.1",
"behat/mink": "~1.6@dev",
"behat/mink-browserkit-driver": "~1.2@dev",
"fabpot/goutte": "~1.0.4|~2.0"
},
"autoload": {
"psr-0": {
"Behat\\Mink\\Driver": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Behat\\Mink\\Tests\\Driver\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
}
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/behat/mink/driver-testsuite/bootstrap.php">
<testsuites>
<testsuite name="Driver test suite">
<directory>tests</directory>
<directory>vendor/behat/mink/driver-testsuite/tests/Basic</directory>
<directory>vendor/behat/mink/driver-testsuite/tests/Form</directory>
</testsuite>
</testsuites>
<php>
<var name="driver_config_factory" value="Behat\Mink\Tests\Driver\GoutteConfig::getInstance" />
<!--server name="WEB_FIXTURES_HOST" value="http://test.mink.dev" /-->
</php>
<filter>
<whitelist>
<directory>./src/Behat/Mink/Driver</directory>
</whitelist>
</filter>
</phpunit>

View file

@ -0,0 +1,43 @@
<?php
/*
* This file is part of the Behat\Mink.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Behat\Mink\Driver\Goutte;
use Goutte\Client as BaseClient;
use Symfony\Component\BrowserKit\Response;
/**
* Client overrides to support Mink functionality.
*/
class Client extends BaseClient
{
/**
* Reads response meta tags to guess content-type charset.
*
* @param Response $response
*
* @return Response
*/
protected function filterResponse($response)
{
$contentType = $response->getHeader('Content-Type');
if (!$contentType || false === strpos($contentType, 'charset=')) {
if (preg_match('/\<meta[^\>]+charset *= *["\']?([a-zA-Z\-0-9]+)/i', $response->getContent(), $matches)) {
$headers = $response->getHeaders();
$headers['Content-Type'] = $contentType.';charset='.$matches[1];
$response = new Response($response->getContent(), $response->getStatus(), $headers);
}
}
return parent::filterResponse($response);
}
}

View file

@ -0,0 +1,75 @@
<?php
/*
* This file is part of the Behat\Mink.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Behat\Mink\Driver;
use Behat\Mink\Driver\Goutte\Client as ExtendedClient;
use Goutte\Client;
/**
* Goutte driver.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
class GoutteDriver extends BrowserKitDriver
{
/**
* Initializes Goutte driver.
*
* @param Client $client Goutte client instance
*/
public function __construct(Client $client = null)
{
parent::__construct($client ?: new ExtendedClient());
}
/**
* {@inheritdoc}
*/
public function setBasicAuth($user, $password)
{
if (false === $user) {
$this->getClient()->resetAuth();
return;
}
$this->getClient()->setAuth($user, $password);
}
/**
* Gets the Goutte client.
*
* The method is overwritten only to provide the appropriate return type hint.
*
* @return Client
*/
public function getClient()
{
return parent::getClient();
}
/**
* {@inheritdoc}
*/
public function reset()
{
parent::reset();
$this->getClient()->resetAuth();
}
/**
* {@inheritdoc}
*/
protected function prepareUrl($url)
{
return $url;
}
}

View file

@ -0,0 +1,27 @@
<?php
namespace Behat\Mink\Tests\Driver\Custom;
use Behat\Mink\Driver\GoutteDriver;
class InstantiationTest extends \PHPUnit_Framework_TestCase
{
public function testInstantiateWithClient()
{
$client = $this->getMockBuilder('Goutte\Client')->disableOriginalConstructor()->getMock();
$client->expects($this->once())
->method('followRedirects')
->with(true);
$driver = new GoutteDriver($client);
$this->assertSame($client, $driver->getClient());
}
public function testInstantiateWithoutClient()
{
$driver = new GoutteDriver();
$this->assertInstanceOf('Behat\Mink\Driver\Goutte\Client', $driver->getClient());
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace Behat\Mink\Tests\Driver;
use Behat\Mink\Driver\GoutteDriver;
class GoutteConfig extends AbstractConfig
{
public static function getInstance()
{
return new self();
}
/**
* {@inheritdoc}
*/
public function createDriver()
{
return new GoutteDriver();
}
protected function supportsJs()
{
return false;
}
}