Update to Drupal 8.2.6. For more information, see https://www.drupal.org/project/drupal/releases/8.2.6

This commit is contained in:
Pantheon Automation 2017-02-02 16:28:38 -08:00 committed by Greg Anderson
parent db56c09587
commit f1e72395cb
588 changed files with 26857 additions and 2777 deletions

View file

@ -68,6 +68,16 @@ abstract class Client
$this->followRedirects = (bool) $followRedirect;
}
/**
* Returns whether client automatically follows redirects or not.
*
* @return bool
*/
public function isFollowingRedirects()
{
return $this->followRedirects;
}
/**
* Sets the maximum number of requests that crawler can follow.
*
@ -79,6 +89,16 @@ abstract class Client
$this->followRedirects = -1 != $this->maxRedirects;
}
/**
* Returns the maximum number of requests that crawler can follow.
*
* @return int
*/
public function getMaxRedirects()
{
return $this->maxRedirects;
}
/**
* Sets the insulated flag.
*
@ -103,7 +123,6 @@ abstract class Client
public function setServerParameters(array $server)
{
$this->server = array_merge(array(
'HTTP_HOST' => 'localhost',
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
), $server);
}
@ -129,7 +148,7 @@ abstract class Client
*/
public function getServerParameter($key, $default = '')
{
return (isset($this->server[$key])) ? $this->server[$key] : $default;
return isset($this->server[$key]) ? $this->server[$key] : $default;
}
/**
@ -266,21 +285,20 @@ abstract class Client
$uri = $this->getAbsoluteUri($uri);
if (!empty($server['HTTP_HOST'])) {
$uri = preg_replace('{^(https?\://)'.preg_quote($this->extractHost($uri)).'}', '${1}'.$server['HTTP_HOST'], $uri);
}
$server = array_merge($this->server, $server);
if (isset($server['HTTPS'])) {
$uri = preg_replace('{^'.parse_url($uri, PHP_URL_SCHEME).'}', $server['HTTPS'] ? 'https' : 'http', $uri);
}
$server = array_merge($this->server, $server);
if (!$this->history->isEmpty()) {
$server['HTTP_REFERER'] = $this->history->current()->getUri();
}
$server['HTTP_HOST'] = $this->extractHost($uri);
if (empty($server['HTTP_HOST'])) {
$server['HTTP_HOST'] = $this->extractHost($uri);
}
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
$this->internalRequest = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
@ -457,7 +475,7 @@ abstract class Client
$request = $this->internalRequest;
if (in_array($this->internalResponse->getStatus(), array(302, 303))) {
$method = 'get';
$method = 'GET';
$files = array();
$content = null;
} else {
@ -466,7 +484,7 @@ abstract class Client
$content = $request->getContent();
}
if ('get' === strtolower($method)) {
if ('GET' === strtoupper($method)) {
// Don't forward parameters for GET request as it should reach the redirection URI
$parameters = array();
} else {
@ -524,9 +542,9 @@ abstract class Client
return parse_url($currentUri, PHP_URL_SCHEME).':'.$uri;
}
// anchor?
if (!$uri || '#' == $uri[0]) {
return preg_replace('/#.*?$/', '', $currentUri).$uri;
// anchor or query string parameters?
if (!$uri || '#' == $uri[0] || '?' == $uri[0]) {
return preg_replace('/[#?].*?$/', '', $currentUri).$uri;
}
if ('/' !== $uri[0]) {

View file

@ -76,7 +76,7 @@ class Cookie
throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.', $expires));
}
$this->expires = $timestampAsDateTime->getTimestamp();
$this->expires = $timestampAsDateTime->format('U');
}
}
@ -121,7 +121,7 @@ class Cookie
* @param string $cookie A Set-Cookie header value
* @param string $url The base URL
*
* @return Cookie A Cookie instance
* @return static
*
* @throws \InvalidArgumentException
*/
@ -205,13 +205,13 @@ class Cookie
foreach (self::$dateFormats as $dateFormat) {
if (false !== $date = \DateTime::createFromFormat($dateFormat, $dateValue, new \DateTimeZone('GMT'))) {
return $date->getTimestamp();
return $date->format('U');
}
}
// attempt a fallback for unusual formatting
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
return $date->getTimestamp();
return $date->format('U');
}
throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue));
@ -304,6 +304,6 @@ class Cookie
*/
public function isExpired()
{
return null !== $this->expires && 0 !== $this->expires && $this->expires < time();
return null !== $this->expires && 0 != $this->expires && $this->expires < time();
}
}

View file

@ -1,4 +1,4 @@
Copyright (c) 2004-2015 Fabien Potencier
Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,23 +1,14 @@
BrowserKit Component
====================
BrowserKit simulates the behavior of a web browser.
The component only provides an abstract client and does not provide any
"default" backend for the HTTP layer.
The BrowserKit component simulates the behavior of a web browser, allowing you
to make requests, click on links and submit forms programmatically.
Resources
---------
For a simple implementation of a browser based on an HTTP layer, have a look
at [Goutte](https://github.com/FriendsOfPHP/Goutte).
For an implementation based on HttpKernelInterface, have a look at the
[Client](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Client.php)
provided by the HttpKernel component.
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/BrowserKit/
$ composer install
$ phpunit
* [Documentation](https://symfony.com/doc/current/components/browser_kit/introduction.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

View file

@ -111,7 +111,7 @@ class Request
/**
* Gets the request raw body data.
*
* @return string The request raw body data.
* @return string The request raw body data
*/
public function getContent()
{

View file

@ -17,22 +17,25 @@
],
"require": {
"php": ">=5.3.9",
"symfony/dom-crawler": "~2.0,>=2.0.5"
"symfony/dom-crawler": "~2.1|~3.0.0"
},
"require-dev": {
"symfony/process": "~2.3.34|~2.7,>=2.7.6",
"symfony/css-selector": "~2.0,>=2.0.5"
"symfony/process": "~2.3.34|~2.7,>=2.7.6|~3.0.0",
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0"
},
"suggest": {
"symfony/process": ""
},
"autoload": {
"psr-4": { "Symfony\\Component\\BrowserKit\\": "" }
"psr-4": { "Symfony\\Component\\BrowserKit\\": "" },
"exclude-from-classmap": [
"/Tests/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}