Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\KernelTests\RequestProcessing\RedirectOnExceptionTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\KernelTests\RequestProcessing;
|
||||
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Tests redirects on exception pages.
|
||||
*
|
||||
* @group request_processing
|
||||
*/
|
||||
class RedirectOnExceptionTest extends KernelTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['system', 'test_page_test'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->installSchema('system', ['router', 'url_alias']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
public function testRedirectOn404() {
|
||||
\Drupal::configFactory()->getEditable('system.site')
|
||||
->set('page.404', '/test-http-response-exception/' . Response::HTTP_PERMANENTLY_REDIRECT)
|
||||
->save();
|
||||
|
||||
/** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */
|
||||
$http_kernel = \Drupal::service('http_kernel');
|
||||
|
||||
// Foo doesn't exist, so this triggers the 404 page.
|
||||
$request = Request::create('/foo');
|
||||
$response = $http_kernel->handle($request);
|
||||
$this->assertEquals(Response::HTTP_PERMANENTLY_REDIRECT, $response->getStatusCode());
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue