diff --git a/.gitignore b/.gitignore index 0e760415e..c2fd2085c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,43 @@ -sites/default/settings.php -sites/default/files +# This file contains default .gitignore rules. To use it, copy it to .gitignore, +# and it will cause files like your settings.php and user-uploaded files to be +# excluded from Git version control. This is a common strategy to avoid +# accidentally including private information in public repositories and patch +# files. +# +# Because .gitignore can be specific to your site, this file has a different +# name; updating Drupal core will not override your custom .gitignore file. +# Ignore core when managing all of a project's dependencies with Composer +# including Drupal core. +# core + +# Core's dependencies are managed with Composer. +vendor + +# Ignore configuration files that may contain sensitive information. +sites/*/settings*.php +sites/*/services*.yml + +# Ignore paths that contain user-generated content. +sites/*/files +sites/*/private + +# Ignore SimpleTest multi-site environment. +sites/simpletest + +# If you prefer to store your .gitignore file in the sites/ folder, comment +# or delete the previous settings and uncomment the following ones, instead. + +# Ignore configuration files that may contain sensitive information. +*/settings*.php + +# Ignore paths that contain user-generated content. +*/files +/private + +# Ignore SimpleTest multi-site environment. +simpletest + +# Ignore core phpcs.xml and phpunit.xml. +core/phpcs.xml +core/phpunit.xml diff --git a/vendor/.htaccess b/vendor/.htaccess deleted file mode 100644 index 90748bbc9..000000000 --- a/vendor/.htaccess +++ /dev/null @@ -1,23 +0,0 @@ -# Deny all requests from Apache 2.4+. - - Require all denied - - -# Deny all requests from Apache 2.0-2.2. - - Deny from all - -# Turn off all options we don't need. -Options -Indexes -ExecCGI -Includes -MultiViews - -# Set the catch-all handler to prevent scripts from being executed. -SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 - - # Override the handler again if we're run later in the evaluation list. - SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 - - -# If we know how to do it safely, disable the PHP engine entirely. - - php_flag engine off - diff --git a/vendor/asm89/stack-cors/.gitignore b/vendor/asm89/stack-cors/.gitignore deleted file mode 100644 index 8844fdc45..000000000 --- a/vendor/asm89/stack-cors/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -phpunit.xml -composer.lock -composer.phar -/vendor/ diff --git a/vendor/asm89/stack-cors/.travis.yml b/vendor/asm89/stack-cors/.travis.yml deleted file mode 100644 index 7eb55a913..000000000 --- a/vendor/asm89/stack-cors/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm - -before_script: composer install --dev - -script: phpunit diff --git a/vendor/asm89/stack-cors/README.md b/vendor/asm89/stack-cors/README.md deleted file mode 100644 index dea18a8e7..000000000 --- a/vendor/asm89/stack-cors/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Stack/Cors - -Library and middleware enabling cross-origin resource sharing for your -http-{foundation,kernel} using application. It attempts to implement the -[W3C Candidate Recommendation] for cross-origin resource sharing. - -[W3C Candidate Recommendation]: http://www.w3.org/TR/cors/ - -Master [![Build Status](https://secure.travis-ci.org/asm89/stack-cors.png?branch=master)](http://travis-ci.org/asm89/stack-cors) -Develop [![Build Status](https://secure.travis-ci.org/asm89/stack-cors.png?branch=develop)](http://travis-ci.org/asm89/stack-cors) - -## Installation - -Require `asm89/stack-cors` using composer. - -## Usage - -Stack middleware: - -```php - array('x-allowed-header', 'x-other-allowed-header'), - // you can use array('*') to allow any methods - 'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'), - // you can use array('*') to allow requests from any origin - 'allowedOrigins' => array('localhost'), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, -)); -``` - -Or use the library: - -```php - array('x-allowed-header', 'x-other-allowed-header'), - 'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'), - 'allowedOrigins' => array('localhost'), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, -)); - -$cors->addActualRequestHeaders(Response $response, $origin); -$cors->handlePreflightRequest(Request $request); -$cors->isActualRequestAllowed(Request $request); -$cors->isCorsRequest(Request $request); -$cors->isPreflightRequest(Request $request); -``` diff --git a/vendor/asm89/stack-cors/composer.json b/vendor/asm89/stack-cors/composer.json deleted file mode 100644 index 02296c616..000000000 --- a/vendor/asm89/stack-cors/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "asm89/stack-cors", - "description": "Cross-origin resource sharing library and stack middleware", - "keywords": ["stack", "cors"], - "homepage": "https://github.com/asm89/stack-cors", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Alexander", - "email": "iam.asm89@gmail.com" - } - ], - "require": { - "php": ">=5.3.2", - "symfony/http-foundation": "~2.1|~3.0", - "symfony/http-kernel": "~2.1|~3.0" - }, - "autoload": { - "psr-0": { "Asm89\\Stack": "src/" } - } -} diff --git a/vendor/asm89/stack-cors/phpunit.xml.dist b/vendor/asm89/stack-cors/phpunit.xml.dist deleted file mode 100644 index 1959e537e..000000000 --- a/vendor/asm89/stack-cors/phpunit.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - ./test/Asm89/ - - - - - - ./src/ - - - - diff --git a/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php b/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php deleted file mode 100755 index a5e81ce21..000000000 --- a/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php +++ /dev/null @@ -1,55 +0,0 @@ - array(), - 'allowedMethods' => array(), - 'allowedOrigins' => array(), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, - ); - - public function __construct(HttpKernelInterface $app, array $options = array()) - { - $this->app = $app; - $this->cors = new CorsService(array_merge($this->defaultOptions, $options)); - - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - if ( ! $this->cors->isCorsRequest($request)) { - return $this->app->handle($request, $type, $catch); - } - - if ($this->cors->isPreflightRequest($request)) { - return $this->cors->handlePreflightRequest($request); - } - - if ( ! $this->cors->isActualRequestAllowed($request)) { - return new Response('Not allowed.', 403); - } - - $response = $this->app->handle($request, $type, $catch); - - return $this->cors->addActualRequestHeaders($response, $request); - } -} diff --git a/vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php b/vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php deleted file mode 100755 index 339256b3c..000000000 --- a/vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php +++ /dev/null @@ -1,178 +0,0 @@ -options = $this->normalizeOptions($options); - } - - private function normalizeOptions(array $options = array()) - { - - $options += array( - 'allowedOrigins' => array(), - 'supportsCredentials' => false, - 'allowedHeaders' => array(), - 'exposedHeaders' => array(), - 'allowedMethods' => array(), - 'maxAge' => 0, - ); - - // normalize array('*') to true - if (in_array('*', $options['allowedOrigins'])) { - $options['allowedOrigins'] = true; - } - if (in_array('*', $options['allowedHeaders'])) { - $options['allowedHeaders'] = true; - } else { - $options['allowedHeaders'] = array_map('strtolower', $options['allowedHeaders']); - } - - if (in_array('*', $options['allowedMethods'])) { - $options['allowedMethods'] = true; - } else { - $options['allowedMethods'] = array_map('strtoupper', $options['allowedMethods']); - } - - return $options; - } - - public function isActualRequestAllowed(Request $request) - { - return $this->checkOrigin($request); - } - - public function isCorsRequest(Request $request) - { - return $request->headers->has('Origin'); - } - - public function isPreflightRequest(Request $request) - { - return $this->isCorsRequest($request) - &&$request->getMethod() === 'OPTIONS' - && $request->headers->has('Access-Control-Request-Method'); - } - - public function addActualRequestHeaders(Response $response, Request $request) - { - if ( ! $this->checkOrigin($request)) { - return $response; - } - - $response->headers->set('Access-Control-Allow-Origin', $request->headers->get('Origin')); - - if ( ! $response->headers->has('Vary')) { - $response->headers->set('Vary', 'Origin'); - } else { - $response->headers->set('Vary', $response->headers->get('Vary') . ', Origin'); - } - - if ($this->options['supportsCredentials']) { - $response->headers->set('Access-Control-Allow-Credentials', 'true'); - } - - if ($this->options['exposedHeaders']) { - $response->headers->set('Access-Control-Expose-Headers', implode(', ', $this->options['exposedHeaders'])); - } - - return $response; - } - - public function handlePreflightRequest(Request $request) - { - if (true !== $check = $this->checkPreflightRequestConditions($request)) { - return $check; - } - - return $this->buildPreflightCheckResponse($request); - } - - private function buildPreflightCheckResponse(Request $request) - { - $response = new Response(); - - if ($this->options['supportsCredentials']) { - $response->headers->set('Access-Control-Allow-Credentials', 'true'); - } - - $response->headers->set('Access-Control-Allow-Origin', $request->headers->get('Origin')); - - if ($this->options['maxAge']) { - $response->headers->set('Access-Control-Max-Age', $this->options['maxAge']); - } - - $allowMethods = $this->options['allowedMethods'] === true - ? strtoupper($request->headers->get('Access-Control-Request-Method')) - : implode(', ', $this->options['allowedMethods']); - $response->headers->set('Access-Control-Allow-Methods', $allowMethods); - - $allowHeaders = $this->options['allowedHeaders'] === true - ? strtoupper($request->headers->get('Access-Control-Request-Headers')) - : implode(', ', $this->options['allowedHeaders']); - $response->headers->set('Access-Control-Allow-Headers', $allowHeaders); - - return $response; - } - - private function checkPreflightRequestConditions(Request $request) - { - if ( ! $this->checkOrigin($request)) { - return $this->createBadRequestResponse(403, 'Origin not allowed'); - } - - if ( ! $this->checkMethod($request)) { - return $this->createBadRequestResponse(405, 'Method not allowed'); - } - - $requestHeaders = array(); - // if allowedHeaders has been set to true ('*' allow all flag) just skip this check - if ($this->options['allowedHeaders'] !== true && $request->headers->has('Access-Control-Request-Headers')) { - $headers = strtolower($request->headers->get('Access-Control-Request-Headers')); - $requestHeaders = explode(',', $headers); - - foreach ($requestHeaders as $header) { - if ( ! in_array(trim($header), $this->options['allowedHeaders'])) { - return $this->createBadRequestResponse(403, 'Header not allowed'); - } - } - } - - return true; - } - - private function createBadRequestResponse($code, $reason = '') - { - return new Response($reason, $code); - } - - private function checkOrigin(Request $request) { - if ($this->options['allowedOrigins'] === true) { - // allow all '*' flag - return true; - } - $origin = $request->headers->get('Origin'); - - return in_array($origin, $this->options['allowedOrigins']); - } - - private function checkMethod(Request $request) { - if ($this->options['allowedMethods'] === true) { - // allow all '*' flag - return true; - } - - $requestMethod = strtoupper($request->headers->get('Access-Control-Request-Method')); - return in_array($requestMethod, $this->options['allowedMethods']); - } - -} diff --git a/vendor/asm89/stack-cors/test/Asm89/Stack/CorsTest.php b/vendor/asm89/stack-cors/test/Asm89/Stack/CorsTest.php deleted file mode 100755 index 1493c46c5..000000000 --- a/vendor/asm89/stack-cors/test/Asm89/Stack/CorsTest.php +++ /dev/null @@ -1,395 +0,0 @@ -createStackedApp(); - $unmodifiedResponse = new Response(); - - $response = $app->handle(new Request()); - - $this->assertEquals($unmodifiedResponse->headers, $response->headers); - } - - /** - * @test - */ - public function it_returns_403_on_valid_actual_request_with_origin_not_allowed() - { - $app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost'))); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertEquals(403, $response->getStatusCode()); - } - - /** - * @test - */ - public function it_returns_allow_origin_header_on_valid_actual_request() - { - $app = $this->createStackedApp(); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Origin')); - $this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin')); - } - - /** - * @test - */ - public function it_returns_allow_origin_header_on_allow_all_origin_request() - { - $app = $this->createStackedApp(array('allowedOrigins' => array('*'))); - $request = new Request(); - $request->headers->set('Origin', 'http://localhost'); - - $response = $app->handle($request); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertTrue($response->headers->has('Access-Control-Allow-Origin')); - $this->assertEquals('http://localhost', $response->headers->get('Access-Control-Allow-Origin')); - } - - /** - * @test - */ - public function it_returns_allow_headers_header_on_allow_all_headers_request() - { - $app = $this->createStackedApp(array('allowedHeaders' => array('*'))); - $request = $this->createValidPreflightRequest(); - $request->headers->set('Access-Control-Request-Headers', 'Foo, BAR'); - - $response = $app->handle($request); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('FOO, BAR', $response->headers->get('Access-Control-Allow-Headers')); - } - - /** - * @test - */ - public function it_does_not_return_allow_origin_header_on_valid_actual_request_with_origin_not_allowed() - { - $app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost'))); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertFalse($response->headers->has('Access-Control-Allow-Origin')); - } - - /** - * @test - */ - public function it_sets_allow_credentials_header_when_flag_is_set_on_valid_actual_request() - { - $app = $this->createStackedApp(array('supportsCredentials' => true)); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Credentials')); - $this->assertEquals('true', $response->headers->get('Access-Control-Allow-Credentials')); - } - - /** - * @test - */ - public function it_does_not_set_allow_credentials_header_when_flag_is_not_set_on_valid_actual_request() - { - $app = $this->createStackedApp(); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertFalse($response->headers->has('Access-Control-Allow-Credentials')); - } - - /** - * @test - */ - public function it_sets_exposed_headers_when_configured_on_actual_request() - { - $app = $this->createStackedApp(array('exposedHeaders' => array('x-exposed-header', 'x-another-exposed-header'))); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Expose-Headers')); - $this->assertEquals('x-exposed-header, x-another-exposed-header', $response->headers->get('Access-Control-Expose-Headers')); - } - - /** - * @test - * @see http://www.w3.org/TR/cors/index.html#resource-implementation - */ - public function it_adds_a_vary_header() - { - $app = $this->createStackedApp(); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Vary')); - $this->assertEquals('Origin', $response->headers->get('Vary')); - } - - /** - * @test - * @see http://www.w3.org/TR/cors/index.html#resource-implementation - */ - public function it_appends_an_existing_vary_header() - { - $app = $this->createStackedApp(array(), array('Vary' => 'Content-Type')); - $request = $this->createValidActualRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Vary')); - $this->assertEquals('Content-Type, Origin', $response->headers->get('Vary')); - } - - /** - * @test - */ - public function it_returns_access_control_headers_on_cors_request() - { - $app = $this->createStackedApp(); - $request = new Request(); - $request->headers->set('Origin', 'localhost'); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Origin')); - $this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin')); - } - - /** - * @test - */ - public function it_returns_access_control_headers_on_valid_preflight_request() - { - $app = $this->createStackedApp(); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Origin')); - $this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin')); - } - - /** - * @test - */ - public function it_returns_403_on_valid_preflight_request_with_origin_not_allowed() - { - $app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost'))); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertEquals(403, $response->getStatusCode()); - } - - /** - * @test - */ - public function it_does_not_modify_request_with_origin_not_allowed() - { - $passedOptions = array( - 'allowedOrigins' => array('notlocalhost'), - ); - - $service = new CorsService($passedOptions); - $request = $this->createValidActualRequest(); - $response = new Response(); - $service->addActualRequestHeaders($response, $request); - - $this->assertEquals($response, new Response()); - } - - /** - * @test - */ - public function it_returns_405_on_valid_preflight_request_with_method_not_allowed() - { - $app = $this->createStackedApp(array('allowedMethods' => array('put'))); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertEquals(405, $response->getStatusCode()); - } - - /** - * @test - */ - public function it_allow_methods_on_valid_preflight_request() - { - $app = $this->createStackedApp(array('allowedMethods' => array('get', 'put'))); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Methods')); - // it will uppercase the methods - $this->assertEquals('GET, PUT', $response->headers->get('Access-Control-Allow-Methods')); - } - - /** - * @test - */ - public function it_returns_valid_preflight_request_with_allow_methods_all() - { - $app = $this->createStackedApp(array('allowedMethods' => array('*'))); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Methods')); - // it will return the Access-Control-Request-Method pass in the request - $this->assertEquals('GET', $response->headers->get('Access-Control-Allow-Methods')); - } - - /** - * @test - */ - public function it_returns_403_on_valid_preflight_request_with_one_of_the_requested_headers_not_allowed() - { - $app = $this->createStackedApp(); - $request = $this->createValidPreflightRequest(); - $request->headers->set('Access-Control-Request-Headers', 'x-not-allowed-header'); - - $response = $app->handle($request); - - $this->assertEquals(403, $response->getStatusCode()); - } - - /** - * @test - */ - public function it_returns_ok_on_valid_preflight_request_with_requested_headers_allowed() - { - $app = $this->createStackedApp(); - $requestHeaders = 'X-Allowed-Header, x-other-allowed-header'; - $request = $this->createValidPreflightRequest(); - $request->headers->set('Access-Control-Request-Headers', $requestHeaders); - - $response = $app->handle($request); - - $this->assertEquals(200, $response->getStatusCode()); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Headers')); - // the response will have the "allowedHeaders" value passed to Cors rather than the request one - $this->assertEquals('x-allowed-header, x-other-allowed-header', $response->headers->get('Access-Control-Allow-Headers')); - } - - /** - * @test - */ - public function it_sets_allow_credentials_header_when_flag_is_set_on_valid_preflight_request() - { - $app = $this->createStackedApp(array('supportsCredentials' => true)); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Allow-Credentials')); - $this->assertEquals('true', $response->headers->get('Access-Control-Allow-Credentials')); - } - - /** - * @test - */ - public function it_does_not_set_allow_credentials_header_when_flag_is_not_set_on_valid_preflight_request() - { - $app = $this->createStackedApp(); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertFalse($response->headers->has('Access-Control-Allow-Credentials')); - } - - /** - * @test - */ - public function it_sets_max_age_when_set() - { - $app = $this->createStackedApp(array('maxAge' => 42)); - $request = $this->createValidPreflightRequest(); - - $response = $app->handle($request); - - $this->assertTrue($response->headers->has('Access-Control-Max-Age')); - $this->assertEquals(42, $response->headers->get('Access-Control-Max-Age')); - } - - private function createValidActualRequest() - { - $request = new Request(); - $request->headers->set('Origin', 'localhost'); - - return $request; - } - - private function createValidPreflightRequest() - { - $request = new Request(); - $request->headers->set('Origin', 'localhost'); - $request->headers->set('Access-Control-Request-Method', 'get'); - $request->setMethod('OPTIONS'); - - return $request; - } - - private function createStackedApp(array $options = array(), array $responseHeaders = array()) - { - $passedOptions = array_merge(array( - 'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'), - 'allowedMethods' => array('delete', 'get', 'post', 'put'), - 'allowedOrigins' => array('localhost'), - 'exposedHeaders' => false, - 'maxAge' => false, - 'supportsCredentials' => false, - ), - $options - ); - - return new Cors(new MockApp($responseHeaders), $passedOptions); - } -} - -class MockApp implements HttpKernelInterface -{ - private $responseHeaders; - - public function __construct(array $responseHeaders) - { - $this->responseHeaders = $responseHeaders; - } - - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - $response = new Response(); - - $response->headers->add($this->responseHeaders); - - return $response; - } -} diff --git a/vendor/asm89/stack-cors/test/bootstrap.php b/vendor/asm89/stack-cors/test/bootstrap.php deleted file mode 100644 index deb617fb8..000000000 --- a/vendor/asm89/stack-cors/test/bootstrap.php +++ /dev/null @@ -1,10 +0,0 @@ -add('Asm89\Stack', __DIR__); - $loader->add('Asm89\Stack', __DIR__ . '/../src'); -} else { - throw new RuntimeException('Install dependencies to run test suite.'); -} - diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 012b79ac8..000000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - -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. diff --git a/vendor/behat/mink-browserkit-driver/README.md b/vendor/behat/mink-browserkit-driver/README.md deleted file mode 100644 index 1903a5fc8..000000000 --- a/vendor/behat/mink-browserkit-driver/README.md +++ /dev/null @@ -1,54 +0,0 @@ -Mink BrowserKit Driver -====================== - -[![Latest Stable Version](https://poser.pugx.org/behat/mink-browserkit-driver/v/stable.png)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Latest Unstable Version](https://poser.pugx.org/behat/mink-browserkit-driver/v/unstable.svg)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Total Downloads](https://poser.pugx.org/behat/mink-browserkit-driver/downloads.png)](https://packagist.org/packages/behat/mink-browserkit-driver) -[![Build Status](https://travis-ci.org/minkphp/MinkBrowserKitDriver.svg?branch=master)](https://travis-ci.org/minkphp/MinkBrowserKitDriver) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/minkphp/MinkBrowserKitDriver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/minkphp/MinkBrowserKitDriver/) -[![Code Coverage](https://scrutinizer-ci.com/g/minkphp/MinkBrowserKitDriver/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/minkphp/MinkBrowserKitDriver/) -[![License](https://poser.pugx.org/behat/mink-browserkit-driver/license.svg)](https://packagist.org/packages/behat/mink-browserkit-driver) - -Usage Example -------------- - -``` php - new Session(new BrowserKitDriver(new Client($app))), -)); - -$mink->getSession('silex')->getPage()->findLink('Chat')->click(); -``` - -Installation ------------- - -``` json -{ - "require": { - "behat/mink": "~1.5", - "behat/mink-browserkit-driver": "~1.1" - } -} -``` - -``` bash -$> curl -sS https://getcomposer.org/installer | php -$> php composer.phar install -``` - -Maintainers ------------ - -* Christophe Coevoet [stof](https://github.com/stof) -* Other [awesome developers](https://github.com/minkphp/MinkBrowserKitDriver/graphs/contributors) diff --git a/vendor/behat/mink-browserkit-driver/composer.json b/vendor/behat/mink-browserkit-driver/composer.json deleted file mode 100644 index 1efa322a6..000000000 --- a/vendor/behat/mink-browserkit-driver/composer.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "behat/mink-browserkit-driver", - "description": "Symfony2 BrowserKit driver for Mink framework", - "keywords": ["Symfony2", "Mink", "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.6", - "behat/mink": "^1.7.1@dev", - "symfony/browser-kit": "~2.3|~3.0", - "symfony/dom-crawler": "~2.3|~3.0" - }, - - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0", - "silex/silex": "~1.2" - }, - - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - - "autoload-dev": { - "psr-4": { - "Behat\\Mink\\Tests\\Driver\\": "tests" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - } -} diff --git a/vendor/behat/mink-browserkit-driver/phpunit.xml.dist b/vendor/behat/mink-browserkit-driver/phpunit.xml.dist deleted file mode 100644 index d91581c24..000000000 --- a/vendor/behat/mink-browserkit-driver/phpunit.xml.dist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - tests - vendor/behat/mink/driver-testsuite/tests/Basic - vendor/behat/mink/driver-testsuite/tests/Form - - - - - - ./src - - - diff --git a/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php b/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php deleted file mode 100644 index cea812596..000000000 --- a/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php +++ /dev/null @@ -1,862 +0,0 @@ - - * - * 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\Exception\DriverException; -use Behat\Mink\Exception\UnsupportedDriverActionException; -use Symfony\Component\BrowserKit\Client; -use Symfony\Component\BrowserKit\Cookie; -use Symfony\Component\BrowserKit\Response; -use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\DomCrawler\Field\ChoiceFormField; -use Symfony\Component\DomCrawler\Field\FileFormField; -use Symfony\Component\DomCrawler\Field\FormField; -use Symfony\Component\DomCrawler\Field\InputFormField; -use Symfony\Component\DomCrawler\Field\TextareaFormField; -use Symfony\Component\DomCrawler\Form; -use Symfony\Component\HttpKernel\Client as HttpKernelClient; - -/** - * Symfony2 BrowserKit driver. - * - * @author Konstantin Kudryashov - */ -class BrowserKitDriver extends CoreDriver -{ - private $client; - - /** - * @var Form[] - */ - private $forms = array(); - private $serverParameters = array(); - private $started = false; - private $removeScriptFromUrl = false; - private $removeHostFromUrl = false; - - /** - * Initializes BrowserKit driver. - * - * @param Client $client BrowserKit client instance - * @param string|null $baseUrl Base URL for HttpKernel clients - */ - public function __construct(Client $client, $baseUrl = null) - { - $this->client = $client; - $this->client->followRedirects(true); - - if ($baseUrl !== null && $client instanceof HttpKernelClient) { - $client->setServerParameter('SCRIPT_FILENAME', parse_url($baseUrl, PHP_URL_PATH)); - } - } - - /** - * Returns BrowserKit HTTP client instance. - * - * @return Client - */ - public function getClient() - { - return $this->client; - } - - /** - * Tells driver to remove hostname from URL. - * - * @param Boolean $remove - * - * @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead. - */ - public function setRemoveHostFromUrl($remove = true) - { - trigger_error( - 'setRemoveHostFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.', - E_USER_DEPRECATED - ); - $this->removeHostFromUrl = (bool) $remove; - } - - /** - * Tells driver to remove script name from URL. - * - * @param Boolean $remove - * - * @deprecated Deprecated as of 1.2, to be removed in 2.0. Pass the base url in the constructor instead. - */ - public function setRemoveScriptFromUrl($remove = true) - { - trigger_error( - 'setRemoveScriptFromUrl() is deprecated as of 1.2 and will be removed in 2.0. Pass the base url in the constructor instead.', - E_USER_DEPRECATED - ); - $this->removeScriptFromUrl = (bool) $remove; - } - - /** - * {@inheritdoc} - */ - public function start() - { - $this->started = true; - } - - /** - * {@inheritdoc} - */ - public function isStarted() - { - return $this->started; - } - - /** - * {@inheritdoc} - */ - public function stop() - { - $this->reset(); - $this->started = false; - } - - /** - * {@inheritdoc} - */ - public function reset() - { - // Restarting the client resets the cookies and the history - $this->client->restart(); - $this->forms = array(); - $this->serverParameters = array(); - } - - /** - * {@inheritdoc} - */ - public function visit($url) - { - $this->client->request('GET', $this->prepareUrl($url), array(), array(), $this->serverParameters); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function getCurrentUrl() - { - $request = $this->client->getInternalRequest(); - - if ($request === null) { - throw new DriverException('Unable to access the request before visiting a page'); - } - - return $request->getUri(); - } - - /** - * {@inheritdoc} - */ - public function reload() - { - $this->client->reload(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function forward() - { - $this->client->forward(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function back() - { - $this->client->back(); - $this->forms = array(); - } - - /** - * {@inheritdoc} - */ - public function setBasicAuth($user, $password) - { - if (false === $user) { - unset($this->serverParameters['PHP_AUTH_USER'], $this->serverParameters['PHP_AUTH_PW']); - - return; - } - - $this->serverParameters['PHP_AUTH_USER'] = $user; - $this->serverParameters['PHP_AUTH_PW'] = $password; - } - - /** - * {@inheritdoc} - */ - public function setRequestHeader($name, $value) - { - $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true); - $name = str_replace('-', '_', strtoupper($name)); - - // CONTENT_* are not prefixed with HTTP_ in PHP when building $_SERVER - if (!isset($contentHeaders[$name])) { - $name = 'HTTP_' . $name; - } - - $this->serverParameters[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function getResponseHeaders() - { - return $this->getResponse()->getHeaders(); - } - - /** - * {@inheritdoc} - */ - public function setCookie($name, $value = null) - { - if (null === $value) { - $this->deleteCookie($name); - - return; - } - - $jar = $this->client->getCookieJar(); - $jar->set(new Cookie($name, $value)); - } - - /** - * Deletes a cookie by name. - * - * @param string $name Cookie name. - */ - private function deleteCookie($name) - { - $path = $this->getCookiePath(); - $jar = $this->client->getCookieJar(); - - do { - if (null !== $jar->get($name, $path)) { - $jar->expire($name, $path); - } - - $path = preg_replace('/.$/', '', $path); - } while ($path); - } - - /** - * Returns current cookie path. - * - * @return string - */ - private function getCookiePath() - { - $path = dirname(parse_url($this->getCurrentUrl(), PHP_URL_PATH)); - - if ('\\' === DIRECTORY_SEPARATOR) { - $path = str_replace('\\', '/', $path); - } - - return $path; - } - - /** - * {@inheritdoc} - */ - public function getCookie($name) - { - // Note that the following doesn't work well because - // Symfony\Component\BrowserKit\CookieJar stores cookies by name, - // path, AND domain and if you don't fill them all in correctly then - // you won't get the value that you're expecting. - // - // $jar = $this->client->getCookieJar(); - // - // if (null !== $cookie = $jar->get($name)) { - // return $cookie->getValue(); - // } - - $allValues = $this->client->getCookieJar()->allValues($this->getCurrentUrl()); - - if (isset($allValues[$name])) { - return $allValues[$name]; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function getStatusCode() - { - return $this->getResponse()->getStatus(); - } - - /** - * {@inheritdoc} - */ - public function getContent() - { - return $this->getResponse()->getContent(); - } - - /** - * {@inheritdoc} - */ - public function findElementXpaths($xpath) - { - $nodes = $this->getCrawler()->filterXPath($xpath); - - $elements = array(); - foreach ($nodes as $i => $node) { - $elements[] = sprintf('(%s)[%d]', $xpath, $i + 1); - } - - return $elements; - } - - /** - * {@inheritdoc} - */ - public function getTagName($xpath) - { - return $this->getCrawlerNode($this->getFilteredCrawler($xpath))->nodeName; - } - - /** - * {@inheritdoc} - */ - public function getText($xpath) - { - $text = $this->getFilteredCrawler($xpath)->text(); - $text = str_replace("\n", ' ', $text); - $text = preg_replace('/ {2,}/', ' ', $text); - - return trim($text); - } - - /** - * {@inheritdoc} - */ - public function getHtml($xpath) - { - // cut the tag itself (making innerHTML out of outerHTML) - return preg_replace('/^\<[^\>]+\>|\<[^\>]+\>$/', '', $this->getOuterHtml($xpath)); - } - - /** - * {@inheritdoc} - */ - public function getOuterHtml($xpath) - { - $node = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - return $node->ownerDocument->saveHTML($node); - } - - /** - * {@inheritdoc} - */ - public function getAttribute($xpath, $name) - { - $node = $this->getFilteredCrawler($xpath); - - if ($this->getCrawlerNode($node)->hasAttribute($name)) { - return $node->attr($name); - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function getValue($xpath) - { - if (in_array($this->getAttribute($xpath, 'type'), array('submit', 'image', 'button'), true)) { - return $this->getAttribute($xpath, 'value'); - } - - $node = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - if ('option' === $node->tagName) { - return $this->getOptionValue($node); - } - - try { - $field = $this->getFormField($xpath); - } catch (\InvalidArgumentException $e) { - return $this->getAttribute($xpath, 'value'); - } - - return $field->getValue(); - } - - /** - * {@inheritdoc} - */ - public function setValue($xpath, $value) - { - $this->getFormField($xpath)->setValue($value); - } - - /** - * {@inheritdoc} - */ - public function check($xpath) - { - $this->getCheckboxField($xpath)->tick(); - } - - /** - * {@inheritdoc} - */ - public function uncheck($xpath) - { - $this->getCheckboxField($xpath)->untick(); - } - - /** - * {@inheritdoc} - */ - public function selectOption($xpath, $value, $multiple = false) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField) { - throw new DriverException(sprintf('Impossible to select an option on the element with XPath "%s" as it is not a select or radio input', $xpath)); - } - - if ($multiple) { - $oldValue = (array) $field->getValue(); - $oldValue[] = $value; - $value = $oldValue; - } - - $field->select($value); - } - - /** - * {@inheritdoc} - */ - public function isSelected($xpath) - { - $optionValue = $this->getOptionValue($this->getCrawlerNode($this->getFilteredCrawler($xpath))); - $selectField = $this->getFormField('(' . $xpath . ')/ancestor-or-self::*[local-name()="select"]'); - $selectValue = $selectField->getValue(); - - return is_array($selectValue) ? in_array($optionValue, $selectValue, true) : $optionValue === $selectValue; - } - - /** - * {@inheritdoc} - */ - public function click($xpath) - { - $crawler = $this->getFilteredCrawler($xpath); - $node = $this->getCrawlerNode($crawler); - $tagName = $node->nodeName; - - if ('a' === $tagName) { - $this->client->click($crawler->link()); - $this->forms = array(); - } elseif ($this->canSubmitForm($node)) { - $this->submit($crawler->form()); - } elseif ($this->canResetForm($node)) { - $this->resetForm($node); - } else { - $message = sprintf('%%s supports clicking on links and submit or reset buttons only. But "%s" provided', $tagName); - - throw new UnsupportedDriverActionException($message, $this); - } - } - - /** - * {@inheritdoc} - */ - public function isChecked($xpath) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField || 'select' === $field->getType()) { - throw new DriverException(sprintf('Impossible to get the checked state of the element with XPath "%s" as it is not a checkbox or radio input', $xpath)); - } - - if ('checkbox' === $field->getType()) { - return $field->hasValue(); - } - - $radio = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - - return $radio->getAttribute('value') === $field->getValue(); - } - - /** - * {@inheritdoc} - */ - public function attachFile($xpath, $path) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof FileFormField) { - throw new DriverException(sprintf('Impossible to attach a file on the element with XPath "%s" as it is not a file input', $xpath)); - } - - $field->upload($path); - } - - /** - * {@inheritdoc} - */ - public function submitForm($xpath) - { - $crawler = $this->getFilteredCrawler($xpath); - - $this->submit($crawler->form()); - } - - /** - * @return Response - * - * @throws DriverException If there is not response yet - */ - protected function getResponse() - { - $response = $this->client->getInternalResponse(); - - if (null === $response) { - throw new DriverException('Unable to access the response before visiting a page'); - } - - return $response; - } - - /** - * Prepares URL for visiting. - * Removes "*.php/" from urls and then passes it to BrowserKitDriver::visit(). - * - * @param string $url - * - * @return string - */ - protected function prepareUrl($url) - { - $replacement = ($this->removeHostFromUrl ? '' : '$1') . ($this->removeScriptFromUrl ? '' : '$2'); - - return preg_replace('#(https?\://[^/]+)(/[^/\.]+\.php)?#', $replacement, $url); - } - - /** - * Returns form field from XPath query. - * - * @param string $xpath - * - * @return FormField - * - * @throws DriverException - */ - protected function getFormField($xpath) - { - $fieldNode = $this->getCrawlerNode($this->getFilteredCrawler($xpath)); - $fieldName = str_replace('[]', '', $fieldNode->getAttribute('name')); - - $formNode = $this->getFormNode($fieldNode); - $formId = $this->getFormNodeId($formNode); - - if (!isset($this->forms[$formId])) { - $this->forms[$formId] = new Form($formNode, $this->getCurrentUrl()); - } - - if (is_array($this->forms[$formId][$fieldName])) { - return $this->forms[$formId][$fieldName][$this->getFieldPosition($fieldNode)]; - } - - return $this->forms[$formId][$fieldName]; - } - - /** - * Returns the checkbox field from xpath query, ensuring it is valid. - * - * @param string $xpath - * - * @return ChoiceFormField - * - * @throws DriverException when the field is not a checkbox - */ - private function getCheckboxField($xpath) - { - $field = $this->getFormField($xpath); - - if (!$field instanceof ChoiceFormField) { - throw new DriverException(sprintf('Impossible to check the element with XPath "%s" as it is not a checkbox', $xpath)); - } - - return $field; - } - - /** - * @param \DOMElement $element - * - * @return \DOMElement - * - * @throws DriverException if the form node cannot be found - */ - private function getFormNode(\DOMElement $element) - { - if ($element->hasAttribute('form')) { - $formId = $element->getAttribute('form'); - $formNode = $element->ownerDocument->getElementById($formId); - - if (null === $formNode || 'form' !== $formNode->nodeName) { - throw new DriverException(sprintf('The selected node has an invalid form attribute (%s).', $formId)); - } - - return $formNode; - } - - $formNode = $element; - - do { - // use the ancestor form element - if (null === $formNode = $formNode->parentNode) { - throw new DriverException('The selected node does not have a form ancestor.'); - } - } while ('form' !== $formNode->nodeName); - - return $formNode; - } - - /** - * Gets the position of the field node among elements with the same name - * - * BrowserKit uses the field name as index to find the field in its Form object. - * When multiple fields have the same name (checkboxes for instance), it will return - * an array of elements in the order they appear in the DOM. - * - * @param \DOMElement $fieldNode - * - * @return integer - */ - private function getFieldPosition(\DOMElement $fieldNode) - { - $elements = $this->getCrawler()->filterXPath('//*[@name=\''.$fieldNode->getAttribute('name').'\']'); - - if (count($elements) > 1) { - // more than one element contains this name ! - // so we need to find the position of $fieldNode - foreach ($elements as $key => $element) { - /** @var \DOMElement $element */ - if ($element->getNodePath() === $fieldNode->getNodePath()) { - return $key; - } - } - } - - return 0; - } - - private function submit(Form $form) - { - $formId = $this->getFormNodeId($form->getFormNode()); - - if (isset($this->forms[$formId])) { - $this->mergeForms($form, $this->forms[$formId]); - } - - // remove empty file fields from request - foreach ($form->getFiles() as $name => $field) { - if (empty($field['name']) && empty($field['tmp_name'])) { - $form->remove($name); - } - } - - foreach ($form->all() as $field) { - // Add a fix for https://github.com/symfony/symfony/pull/10733 to support Symfony versions which are not fixed - if ($field instanceof TextareaFormField && null === $field->getValue()) { - $field->setValue(''); - } - } - - $this->client->submit($form); - - $this->forms = array(); - } - - private function resetForm(\DOMElement $fieldNode) - { - $formNode = $this->getFormNode($fieldNode); - $formId = $this->getFormNodeId($formNode); - unset($this->forms[$formId]); - } - - /** - * Determines if a node can submit a form. - * - * @param \DOMElement $node Node. - * - * @return boolean - */ - private function canSubmitForm(\DOMElement $node) - { - $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null; - - if ('input' === $node->nodeName && in_array($type, array('submit', 'image'), true)) { - return true; - } - - return 'button' === $node->nodeName && (null === $type || 'submit' === $type); - } - - /** - * Determines if a node can reset a form. - * - * @param \DOMElement $node Node. - * - * @return boolean - */ - private function canResetForm(\DOMElement $node) - { - $type = $node->hasAttribute('type') ? $node->getAttribute('type') : null; - - return in_array($node->nodeName, array('input', 'button'), true) && 'reset' === $type; - } - - /** - * Returns form node unique identifier. - * - * @param \DOMElement $form - * - * @return string - */ - private function getFormNodeId(\DOMElement $form) - { - return md5($form->getLineNo() . $form->getNodePath() . $form->nodeValue); - } - - /** - * Gets the value of an option element - * - * @param \DOMElement $option - * - * @return string - * - * @see \Symfony\Component\DomCrawler\Field\ChoiceFormField::buildOptionValue - */ - private function getOptionValue(\DOMElement $option) - { - if ($option->hasAttribute('value')) { - return $option->getAttribute('value'); - } - - if (!empty($option->nodeValue)) { - return $option->nodeValue; - } - - return '1'; // DomCrawler uses 1 by default if there is no text in the option - } - - /** - * Merges second form values into first one. - * - * @param Form $to merging target - * @param Form $from merging source - */ - private function mergeForms(Form $to, Form $from) - { - foreach ($from->all() as $name => $field) { - $fieldReflection = new \ReflectionObject($field); - $nodeReflection = $fieldReflection->getProperty('node'); - $valueReflection = $fieldReflection->getProperty('value'); - - $nodeReflection->setAccessible(true); - $valueReflection->setAccessible(true); - - $isIgnoredField = $field instanceof InputFormField && - in_array($nodeReflection->getValue($field)->getAttribute('type'), array('submit', 'button', 'image'), true); - - if (!$isIgnoredField) { - $valueReflection->setValue($to[$name], $valueReflection->getValue($field)); - } - } - } - - /** - * Returns DOMElement from crawler instance. - * - * @param Crawler $crawler - * - * @return \DOMElement - * - * @throws DriverException when the node does not exist - */ - private function getCrawlerNode(Crawler $crawler) - { - $node = null; - - if ($crawler instanceof \Iterator) { - // for symfony 2.3 compatibility as getNode is not public before symfony 2.4 - $crawler->rewind(); - $node = $crawler->current(); - } else { - $node = $crawler->getNode(0); - } - - if (null !== $node) { - return $node; - } - - throw new DriverException('The element does not exist'); - } - - /** - * Returns a crawler filtered for the given XPath, requiring at least 1 result. - * - * @param string $xpath - * - * @return Crawler - * - * @throws DriverException when no matching elements are found - */ - private function getFilteredCrawler($xpath) - { - if (!count($crawler = $this->getCrawler()->filterXPath($xpath))) { - throw new DriverException(sprintf('There is no element matching XPath "%s"', $xpath)); - } - - return $crawler; - } - - /** - * Returns crawler instance (got from client). - * - * @return Crawler - * - * @throws DriverException - */ - private function getCrawler() - { - $crawler = $this->client->getCrawler(); - - if (null === $crawler) { - throw new DriverException('Unable to access the response content before visiting a page'); - } - - return $crawler; - } -} diff --git a/vendor/behat/mink-goutte-driver/.gitignore b/vendor/behat/mink-goutte-driver/.gitignore deleted file mode 100644 index 1d034f43f..000000000 --- a/vendor/behat/mink-goutte-driver/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -phpunit.xml diff --git a/vendor/behat/mink-goutte-driver/.travis.yml b/vendor/behat/mink-goutte-driver/.travis.yml deleted file mode 100644 index 0b33828af..000000000 --- a/vendor/behat/mink-goutte-driver/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - $HOME/.composer/cache/files - -php: [5.3, 5.4, 5.5, 5.6, 7.0, hhvm] - -before_install: - # Force using Goutte 2 on HHVM for now because Guzzle 6 is broken there - - if [ "hhvm" = "$TRAVIS_PHP_VERSION" ]; then composer require fabpot/goutte '~2' --no-update; fi - -install: - - composer install - -before_script: - - export WEB_FIXTURES_HOST=http://localhost:8000 - - # Start a webserver for web fixtures. Force using PHP 5.6 to be able to run it on PHP 5.3 and HHVM jobs too - - ~/.phpenv/versions/5.6/bin/php -S localhost:8000 -t vendor/behat/mink/driver-testsuite/web-fixtures > /dev/null 2>&1 & - -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 diff --git a/vendor/behat/mink-goutte-driver/CHANGELOG.md b/vendor/behat/mink-goutte-driver/CHANGELOG.md deleted file mode 100644 index e3af1103a..000000000 --- a/vendor/behat/mink-goutte-driver/CHANGELOG.md +++ /dev/null @@ -1,38 +0,0 @@ -1.2.1 / 2016-03-05 -================== - -Testsuite: - -* Added testing on PHP 7 - -1.2.0 / 2015-09-21 -================== - -New features: - -* Added support for Goutte 3.1+ - -Misc: - -* Updated the repository structure to PSR-4 - -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 diff --git a/vendor/behat/mink-goutte-driver/LICENSE b/vendor/behat/mink-goutte-driver/LICENSE deleted file mode 100644 index 3365ae632..000000000 --- a/vendor/behat/mink-goutte-driver/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012-2013 Konstantin Kudryashov - -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. diff --git a/vendor/behat/mink-goutte-driver/README.md b/vendor/behat/mink-goutte-driver/README.md deleted file mode 100644 index cba60a08b..000000000 --- a/vendor/behat/mink-goutte-driver/README.md +++ /dev/null @@ -1,60 +0,0 @@ -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/minkphp/MinkGoutteDriver.svg?branch=master)](https://travis-ci.org/minkphp/MinkGoutteDriver) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/minkphp/MinkGoutteDriver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/minkphp/MinkGoutteDriver/) -[![Code Coverage](https://scrutinizer-ci.com/g/minkphp/MinkGoutteDriver/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/minkphp/MinkGoutteDriver/) -[![License](https://poser.pugx.org/behat/mink-goutte-driver/license.svg)](https://packagist.org/packages/behat/mink-goutte-driver) - -Usage Example -------------- - -``` php - new Session(new GoutteDriver(new GoutteClient())), -)); - -$session = $mink->getSession('goutte'); -$session->visit("http://php.net/"); -$session->getPage()->clickLink('Downloads'); -echo $session->getCurrentUrl() . PHP_EOL; -``` - -Installation ------------- - -Add a file composer.json with content: - -``` json -{ - "require": { - "behat/mink": "~1.5", - "behat/mink-goutte-driver": "~1.0" - } -} -``` - -(or merge the above into your project's existing composer.json file) - -``` bash -$> curl -sS https://getcomposer.org/installer | php -$> php composer.phar install -``` - -Maintainers ------------ - -* Christophe Coevoet [stof](https://github.com/stof) -* Other [awesome developers](https://github.com/minkphp/MinkGoutteDriver/graphs/contributors) diff --git a/vendor/behat/mink-goutte-driver/composer.json b/vendor/behat/mink-goutte-driver/composer.json deleted file mode 100644 index 66d352b5a..000000000 --- a/vendor/behat/mink-goutte-driver/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "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|~3.1" - }, - - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - - "autoload-dev": { - "psr-4": { - "Behat\\Mink\\Tests\\Driver\\": "tests" - } - }, - - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - } -} diff --git a/vendor/behat/mink-goutte-driver/phpunit.xml.dist b/vendor/behat/mink-goutte-driver/phpunit.xml.dist deleted file mode 100644 index cbe57c47d..000000000 --- a/vendor/behat/mink-goutte-driver/phpunit.xml.dist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - tests - vendor/behat/mink/driver-testsuite/tests/Basic - vendor/behat/mink/driver-testsuite/tests/Form - - - - - - - - - - - - ./src - - - diff --git a/vendor/behat/mink-goutte-driver/src/Goutte/Client.php b/vendor/behat/mink-goutte-driver/src/Goutte/Client.php deleted file mode 100644 index 9d64be760..000000000 --- a/vendor/behat/mink-goutte-driver/src/Goutte/Client.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * 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('/\]+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); - } -} diff --git a/vendor/behat/mink-goutte-driver/src/GoutteDriver.php b/vendor/behat/mink-goutte-driver/src/GoutteDriver.php deleted file mode 100644 index a42d5a26a..000000000 --- a/vendor/behat/mink-goutte-driver/src/GoutteDriver.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * 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 - */ -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; - } -} diff --git a/vendor/behat/mink/CHANGES.md b/vendor/behat/mink/CHANGES.md deleted file mode 100644 index d78b8139f..000000000 --- a/vendor/behat/mink/CHANGES.md +++ /dev/null @@ -1,322 +0,0 @@ -1.7.1 / 2016-03-XX -================== - -Bug fixes: - -* Refactored the CssSelector to use the new API of the Symfony CssSelector component to be compatible with Symfony 3 - - -Testsuite: - -* Disallowed failures on PHP 7 on Travis (tests were passing since a long time) - -Driver testsuite: - -* Fixed the driver testsuite to account for driver inheritance when checking recommended practices -* Added a test for cookie values with semicolon, to ensure all drivers support it -* Improved the window resize test to consider headless browsers -* Fixed the compatibility of the testsuite with PHPUnit 5 -* Added a test ensuring that `wait()` always return a boolean even when the JS expression does not cast the value -* Added HTML escaping of submitted values in the driver testsuite web-fixtures - -Misc: - -* Removed the Mink testsuite from archives generated by Github to make them smaller - -1.7.0 / 2015-09-20 -================== - -New features: - -* Added `Session::getResponseHeader` to access a response header easily -* Added support for header assertions -* Added a forward compatibility layer for drivers to allow them to prepare - for Mink 2.0 (they won't require any change if they use it). They should - now overwrite `CoreDriver::findElementXpaths` instead of implementing `find` - and `setSession` themselves. -* Added escaping of the locator in the NamedSelector rather than expecting - the caller to perform the escaping. Passing an escaped locator is still - supported but deprecated. -* Remove the dependency on the Session in expectation exceptions. Passing - the session in the exception constructor is now deprecated. The driver - should be passed instead. - -Bug fixes: - -* Fixed the URL assertions when comparing paths ending in ``.php`` -* Silenced deprecation warnings (following the Symfony convention) to make - them less invasive. Use the `symfony/phpunit-bridge` to get them reported - when using Mink in your PHPUnit tests. -* Fixed `NodeElement::hasClass` in case the class attribute contains newlines - -Testsuite: - -* Made the testsuite compatible with PHPUnit strict timing mode (only the library testsuite, not the driver one) -* Added testing against PHP 7 -* Added testing against lowest version of dependencies to ensure we got the lower bounds right - -Driver testsuite: - -* Added an extra test to ensure the right behavior when getting the HTML with empty elements -* Added a few more safeguards to ensure test failures rather than fatal errors for misbehaving drivers -* Added a test ensuring that drivers follow recommended practices - -Misc: - -* Added a few missing deprecation warnings for deprecated APIs or classes. - -1.6.1 / 2015-02-04 -================== - -Bug fixes: - -* Added a check for empty path in `WebAssert::cleanUrl()` - -Driver testsuite: - -* Added an extra test to ensure the right behavior for traversal - -Misc: - -* Changed the description in the composer.json -* Switched the repository structure to use PSR-4 -* Updated URLs for the move to the new Github organization - -1.6.0 / 2014-09-26 -================== - - * [BC break] Changed the named selector to prefer exact matches over partial matches - * [BC break] Changed `NodeElement::getValue` for checkboxes to return the value rather than the checked state (use `isChecked` for that) - * Fixed the XPath prefixing when searching inside an existing element - * Refactored the driver testsuite entirely and expand it to cover drivers entirely (covering many more cases for consistency) - * Changed `NodeElement::setValue` to support any fields rather than only input elements - * Removed the wrapping of any driver-level exception in a MinkException on invalid usage as it was making the code too complex - * Fixed the matching of the input type in the named selector to be case insensitive according to the HTML spec - * Introduced `Behat\Mink\Selector\Xpath\Escaper` to allow reusing the XPath escaping - * Deprecated `Element::getSession`. Code needing the session should get it from outside rather than the element - * Changed ElementNotFoundException to extend from ExpectationException - * Added `Element::getOuterHtml` to get the HTML code of the element including itself - * Fixed the name selectors to match on the `placeholder` only for textual inputs - * Enforced consistent behavior for drivers on 4xx and 5xx response to return the response rather than throwing an exception - * Added `Element::waitFor` to allow retrying some code until it succeeds or the timeout is reached - * Added `Element::isValid` to check whether an element still exists in the page - * Made `Session::executeScript` compatible across drivers by ensuring they all support the same syntaxes for the JS expression - * Made `Session::evaluateScript` compatible across drivers by ensuring they all support the same syntaxes for the JS expression - * Removed `hasClass` from `DocumentElement` (instead of triggering a fatal error) - * Added testing on HHVM to ensure consistency - * Fixed `NodeElement::getTagName` to ensure that the tag name is lowercase for all drivers - * Fixed `Element::hasAttribute` to ensure it supports attributes with an empty value - * Fixed the `field` selector to avoid matching inputs with the type `submit` or `reset` - * Changed the button XPath selection to accept `reset` buttons as well - * Changed `Session::wait` to return the condition value rather than nothing - * Added `Session::getWindowName` and `Session::getWindowNames` to get the name of the current and of all windows - * Added `Session::maximizeWindow` to maximize the window - * Added `NodeElement::isSelected` to check whether an `