Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668

This commit is contained in:
Pantheon Automation 2015-10-21 21:44:50 -07:00 committed by Greg Anderson
parent f32e58e4b1
commit 8e18df8c36
3062 changed files with 15044 additions and 172506 deletions

0
vendor/behat/mink-browserkit-driver/README.md vendored Executable file → Normal file
View file

View file

@ -1,37 +0,0 @@
<?php
namespace Behat\Mink\Tests\Driver;
use Behat\Mink\Driver\BrowserKitDriver;
use Symfony\Component\HttpKernel\Client;
class BrowserKitConfig extends AbstractConfig
{
public static function getInstance()
{
return new self();
}
/**
* {@inheritdoc}
*/
public function createDriver()
{
$client = new Client(require(__DIR__.'/app.php'));
return new BrowserKitDriver($client);
}
/**
* {@inheritdoc}
*/
public function getWebFixturesUrl()
{
return 'http://localhost';
}
protected function supportsJs()
{
return false;
}
}

View file

@ -1,24 +0,0 @@
<?php
namespace Behat\Mink\Tests\Driver\Custom;
use Behat\Mink\Driver\BrowserKitDriver;
use Behat\Mink\Session;
use Symfony\Component\HttpKernel\Client;
/**
* @group functional
*/
class BaseUrlTest extends \PHPUnit_Framework_TestCase
{
public function testBaseUrl()
{
$client = new Client(require(__DIR__.'/../app.php'));
$driver = new BrowserKitDriver($client, 'http://localhost/foo/');
$session = new Session($driver);
$session->visit('http://localhost/foo/index.html');
$this->assertEquals(200, $session->getStatusCode());
$this->assertEquals('http://localhost/foo/index.html', $session->getCurrentUrl());
}
}

View file

@ -1,181 +0,0 @@
<?php
namespace Behat\Mink\Tests\Driver\Custom;
use Behat\Mink\Driver\BrowserKitDriver;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\BrowserKit\Response;
class ErrorHandlingTest extends \PHPUnit_Framework_TestCase
{
/**
* @var TestClient
*/
private $client;
protected function setUp()
{
$this->client = new TestClient();
}
public function testGetClient()
{
$this->assertSame($this->client, $this->getDriver()->getClient());
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage Unable to access the response before visiting a page
*/
public function testGetResponseHeaderWithoutVisit()
{
$this->getDriver()->getResponseHeaders();
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage Unable to access the response content before visiting a page
*/
public function testFindWithoutVisit()
{
$this->getDriver()->find('//html');
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage Unable to access the request before visiting a page
*/
public function testGetCurrentUrlWithoutVisit()
{
$this->getDriver()->getCurrentUrl();
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage The selected node has an invalid form attribute (foo)
*/
public function testNotMatchingHtml5FormId()
{
$html = <<<'HTML'
<html>
<body>
<form id="test">
<input name="test" value="foo" form="foo">
<input type="submit">
</form>
</body>
</html>
HTML;
$this->client->setNextResponse(new Response($html));
$driver = $this->getDriver();
$driver->visit('/index.php');
$driver->setValue('//input[./@name="test"]', 'bar');
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage The selected node has an invalid form attribute (foo)
*/
public function testInvalidHtml5FormId()
{
$html = <<<'HTML'
<html>
<body>
<form id="test">
<input name="test" value="foo" form="foo">
<input type="submit">
</form>
<div id="foo"></div>
</body>
</html>
HTML;
$this->client->setNextResponse(new Response($html));
$driver = $this->getDriver();
$driver->visit('/index.php');
$driver->setValue('//input[./@name="test"]', 'bar');
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage The selected node does not have a form ancestor.
*/
public function testManipulateInputWithoutForm()
{
$html = <<<'HTML'
<html>
<body>
<form id="test">
<input type="submit">
</form>
<div id="foo">
<input name="test" value="foo">
</div>
</body>
</html>
HTML;
$this->client->setNextResponse(new Response($html));
$driver = $this->getDriver();
$driver->visit('/index.php');
$driver->setValue('//input[./@name="test"]', 'bar');
}
/**
* @expectedException \Behat\Mink\Exception\DriverException
* @expectedExceptionMessage Behat\Mink\Driver\BrowserKitDriver supports clicking on links and submit or reset buttons only. But "div" provided
*/
public function testClickOnUnsupportedElement()
{
$html = <<<'HTML'
<html>
<body>
<div></div>
</body>
</html>
HTML;
$this->client->setNextResponse(new Response($html));
$driver = $this->getDriver();
$driver->visit('/index.php');
$driver->click('//div');
}
private function getDriver()
{
return new BrowserKitDriver($this->client);
}
}
class TestClient extends Client
{
protected $nextResponse = null;
protected $nextScript = null;
public function setNextResponse(Response $response)
{
$this->nextResponse = $response;
}
public function setNextScript($script)
{
$this->nextScript = $script;
}
protected function doRequest($request)
{
if (null === $this->nextResponse) {
return new Response();
}
$response = $this->nextResponse;
$this->nextResponse = null;
return $response;
}
}

View file

@ -1,37 +0,0 @@
<?php
namespace app;
$app = new \Silex\Application();
$app->register(new \Silex\Provider\SessionServiceProvider());
$def = realpath(__DIR__.'/../vendor/behat/mink/driver-testsuite/web-fixtures');
$ovr = realpath(__DIR__.'/web-fixtures');
$cbk = function ($file) use ($app, $def, $ovr) {
$file = str_replace('.file', '.php', $file);
$path = file_exists($ovr.'/'.$file) ? $ovr.'/'.$file : $def.'/'.$file;
$resp = null;
ob_start();
include($path);
$content = ob_get_clean();
if ($resp) {
if ('' === $resp->getContent()) {
$resp->setContent($content);
}
return $resp;
}
return $content;
};
$app->get('/{file}', $cbk)->assert('file', '.*');
$app->post('/{file}', $cbk)->assert('file', '.*');
$app['debug'] = true;
$app['exception_handler']->disable();
$app['session.test'] = true;
return $app;

View file

@ -1,3 +0,0 @@
<?php
$resp = new Symfony\Component\HttpFoundation\Response('Sorry, page not found', 404);

View file

@ -1,3 +0,0 @@
<?php
$resp = new Symfony\Component\HttpFoundation\Response('Sorry, a server error happened', 500);

View file

@ -1,32 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Advanced form save</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
<?php
error_reporting(0);
$request = $app['request'];
$POST = $request->request->all();
$FILES = $request->files->all();
if (isset($POST['select_multiple_numbers']) && false !== strpos($POST['select_multiple_numbers'][0], ',')) {
$POST['select_multiple_numbers'] = explode(',', $POST['select_multiple_numbers'][0]);
}
// checkbox can have any value and will be successful in case "on"
// http://www.w3.org/TR/html401/interact/forms.html#checkbox
$POST['agreement'] = isset($POST['agreement']) ? 'on' : 'off';
ksort($POST);
echo str_replace('>', '', var_export($POST, true)) . "\n";
if (isset($FILES['about']) && file_exists($FILES['about']->getPathname())) {
echo $FILES['about']->getClientOriginalName() . "\n";
echo file_get_contents($FILES['about']->getPathname());
} else {
echo "no file";
}
?>
</body>
</html>

View file

@ -1,15 +0,0 @@
<?php
$SERVER = $app['request']->server->all();
$username = isset($SERVER['PHP_AUTH_USER']) ? $SERVER['PHP_AUTH_USER'] : false;
$password = isset($SERVER['PHP_AUTH_PW']) ? $SERVER['PHP_AUTH_PW'] : false;
if ($username == 'mink-user' && $password == 'mink-password') {
echo 'is authenticated';
} else {
$resp = new \Symfony\Component\HttpFoundation\Response();
$resp->setStatusCode(401);
$resp->headers->set('WWW-Authenticate', 'Basic realm="Mink Testing Area"');
echo 'is not authenticated';
}

View file

@ -1,14 +0,0 @@
<?php ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Basic Form Saving</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<h1>Anket for <?php echo $app['request']->request->get('first_name') ?></h1>
<span id="first">Firstname: <?php echo $app['request']->request->get('first_name') ?></span>
<span id="last">Lastname: <?php echo $app['request']->request->get('last_name') ?></span>
</body>
</html>

View file

@ -1,23 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Basic Get Form</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<h1>Basic Get Form Page</h1>
<div id="serach">
<?php
$GET = $app['request']->query->all();
echo isset($GET['q']) && $GET['q'] ? $GET['q'] : 'No search query'
?>
</div>
<form>
<input name="q" value="" type="text" />
<input type="submit" value="Find" />
</form>
</body>
</html>

View file

@ -1,17 +0,0 @@
<?php
$resp = new Symfony\Component\HttpFoundation\Response();
$cook = new Symfony\Component\HttpFoundation\Cookie('srvr_cookie', 'srv_var_is_set', 0, '/');
$resp->headers->setCookie($cook);
?>
<!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>basic form</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<script>
</script>
</head>
<body>
basic page with cookie set from server side
</body>
</html>

View file

@ -1,14 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Basic Form</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<script>
</script>
</head>
<body>
Previous cookie: <?php
echo $app['request']->cookies->has('srvr_cookie') ? $app['request']->cookies->get('srvr_cookie') : 'NO';
?>
</body>
</html>

View file

@ -1,20 +0,0 @@
<?php
$hasCookie = $app['request']->cookies->has('foo');
$resp = new Symfony\Component\HttpFoundation\Response();
$cook = new Symfony\Component\HttpFoundation\Cookie('foo', 'bar');
$resp->headers->setCookie($cook);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>HttpOnly Cookie Test</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<script>
</script>
</head>
<body>
<div id="cookie-status">Has Cookie: <?php echo json_encode($hasCookie) ?></div>
</body>
</html>

View file

@ -1,10 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Headers page</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<?php print_r($app['request']->server->all()); ?>
</body>
</html>

View file

@ -1,14 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<body>
<?php
if ('1' === $app['request']->query->get('p')) {
echo '<a href="/issue130.php?p=2">Go to 2</a>';
} else {
echo '<strong>'.$app['request']->headers->get('referer').'</strong>';
}
?>
</body>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<body>
<?php if ($app['request']->isMethod('POST')) {
$resp = new Symfony\Component\HttpFoundation\Response();
$cook = new Symfony\Component\HttpFoundation\Cookie('tc', $app['request']->request->get('cookie_value'));
$resp->headers->setCookie($cook);
} elseif ($app['request']->query->has('show_value')) {
echo $app['request']->cookies->get('tc');
return;
}
?>
<form method="post">
<input name="cookie_value">
<input type="submit" value="Set cookie">
</form>
</body>

View file

@ -1,25 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Cookies page</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body>
<?php
$cookies = $app['request']->cookies->all();
unset($cookies['MOCKSESSID']);
if (isset($cookies['srvr_cookie'])) {
$srvrCookie = $cookies['srvr_cookie'];
unset($cookies['srvr_cookie']);
$cookies['_SESS'] = '';
$cookies['srvr_cookie'] = $srvrCookie;
}
foreach ($cookies as $name => $val) {
$cookies[$name] = (string)$val;
}
echo str_replace(array('>'), '', var_export($cookies, true));
?>
</body>
</html>

View file

@ -1,3 +0,0 @@
<?php
$resp = new Symfony\Component\HttpFoundation\RedirectResponse('/redirect_destination.html');

View file

@ -1,15 +0,0 @@
<?php
$resp = new Symfony\Component\HttpFoundation\Response();
$resp->headers->set('X-Mink-Test', 'response-headers');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Response headers</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>Response headers</h1>
</body>
</html>

View file

@ -1,19 +0,0 @@
<?php
$session = $app['request']->getSession();
if ($app['request']->query->has('login')) {
$session->migrate();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Session Test</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<script>
</script>
</head>
<body>
<div id="session-id"><?php echo $session->getId() ?></div>
</body>
</html>

View file

@ -1,18 +0,0 @@
<?php
$requestUri = $app['request']->server->get('REQUEST_URI');
$resp = new Symfony\Component\HttpFoundation\Response();
$cook = new Symfony\Component\HttpFoundation\Cookie('srvr_cookie', 'srv_var_is_set_sub_folder', 0, dirname($requestUri));
$resp->headers->setCookie($cook);
?>
<!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>basic form</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<script>
</script>
</head>
<body>
basic page with cookie set from server side
</body>
</html>

View file

@ -1,18 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>Basic Form</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<script>
</script>
</head>
<body>
Previous cookie: <?php
if ($app['request']->cookies->has('srvr_cookie')) {
echo $app['request']->cookies->get('srvr_cookie');
} else {
echo 'NO';
}
?>
</body>
</html>