summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-02-03 13:44:03 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-02-04 11:17:33 +0000
commit7def76c7d817a9ec81e9ae4a03a850514b1a2e1c (patch)
tree3fcf7e8236356daac44f7c17b8c0c5bc736a0926 /vendor/symfony/http-kernel/Tests/HttpKernelTest.php
parentadfb3656b8dac8505590490f4f8aaf4bea27881b (diff)
downloadwebtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.gz
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.bz2
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.zip
Working on upgrade wizard and testing
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/HttpKernelTest.php')
-rw-r--r--vendor/symfony/http-kernel/Tests/HttpKernelTest.php44
1 files changed, 22 insertions, 22 deletions
diff --git a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
index 63a276a15e..4d1e267e3a 100644
--- a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
@@ -105,7 +105,7 @@ class HttpKernelTest extends TestCase
$event->setResponse(new Response($event->getException()->getMessage()));
});
- $kernel = $this->getHttpKernel($dispatcher, function () { throw new MethodNotAllowedHttpException(array('POST')); });
+ $kernel = $this->getHttpKernel($dispatcher, function () { throw new MethodNotAllowedHttpException(['POST']); });
$response = $kernel->handle(new Request());
$this->assertEquals('405', $response->getStatusCode());
@@ -114,12 +114,12 @@ class HttpKernelTest extends TestCase
public function getStatusCodes()
{
- return array(
- array(200, 404),
- array(404, 200),
- array(301, 200),
- array(500, 200),
- );
+ return [
+ [200, 404],
+ [404, 200],
+ [301, 200],
+ [500, 200],
+ ];
}
/**
@@ -141,11 +141,11 @@ class HttpKernelTest extends TestCase
public function getSpecificStatusCodes()
{
- return array(
- array(200),
- array(302),
- array(403),
- );
+ return [
+ [200],
+ [302],
+ [403],
+ ];
}
public function testHandleWhenAListenerReturnsAResponse()
@@ -199,7 +199,7 @@ class HttpKernelTest extends TestCase
public function testHandleWhenTheControllerIsAnArray()
{
$dispatcher = new EventDispatcher();
- $kernel = $this->getHttpKernel($dispatcher, array(new TestController(), 'controller'));
+ $kernel = $this->getHttpKernel($dispatcher, [new TestController(), 'controller']);
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
}
@@ -207,7 +207,7 @@ class HttpKernelTest extends TestCase
public function testHandleWhenTheControllerIsAStaticArray()
{
$dispatcher = new EventDispatcher();
- $kernel = $this->getHttpKernel($dispatcher, array('Symfony\Component\HttpKernel\Tests\TestController', 'staticcontroller'));
+ $kernel = $this->getHttpKernel($dispatcher, ['Symfony\Component\HttpKernel\Tests\TestController', 'staticcontroller']);
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
}
@@ -258,7 +258,7 @@ class HttpKernelTest extends TestCase
{
$dispatcher = new EventDispatcher();
$dispatcher->addListener(KernelEvents::CONTROLLER_ARGUMENTS, function (FilterControllerArgumentsEvent $event) {
- $event->setArguments(array('foo'));
+ $event->setArguments(['foo']);
});
$kernel = $this->getHttpKernel($dispatcher, function ($content) { return new Response($content); });
@@ -282,12 +282,12 @@ class HttpKernelTest extends TestCase
};
$event->setController($newController);
- $event->setArguments(array('bar'));
+ $event->setArguments(['bar']);
});
- $kernel = $this->getHttpKernel($dispatcher, function ($content) { return new Response($content); }, null, array('foo'));
+ $kernel = $this->getHttpKernel($dispatcher, function ($content) { return new Response($content); }, null, ['foo']);
- $this->assertResponseEquals(new Response('foo', 200, array('X-Id' => 'bar')), $kernel->handle(new Request()));
+ $this->assertResponseEquals(new Response('foo', 200, ['X-Id' => 'bar']), $kernel->handle(new Request()));
}
public function testTerminate()
@@ -312,7 +312,7 @@ class HttpKernelTest extends TestCase
{
$request = new Request();
- $stack = $this->getMockBuilder('Symfony\Component\HttpFoundation\RequestStack')->setMethods(array('push', 'pop'))->getMock();
+ $stack = $this->getMockBuilder('Symfony\Component\HttpFoundation\RequestStack')->setMethods(['push', 'pop'])->getMock();
$stack->expects($this->at(0))->method('push')->with($this->equalTo($request));
$stack->expects($this->at(1))->method('pop');
@@ -328,7 +328,7 @@ class HttpKernelTest extends TestCase
public function testInconsistentClientIpsOnMasterRequests()
{
$request = new Request();
- $request->setTrustedProxies(array('1.1.1.1'), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_FORWARDED);
+ $request->setTrustedProxies(['1.1.1.1'], Request::HEADER_X_FORWARDED_FOR | Request::HEADER_FORWARDED);
$request->server->set('REMOTE_ADDR', '1.1.1.1');
$request->headers->set('FORWARDED', 'for=2.2.2.2');
$request->headers->set('X_FORWARDED_FOR', '3.3.3.3');
@@ -341,10 +341,10 @@ class HttpKernelTest extends TestCase
$kernel = $this->getHttpKernel($dispatcher);
$kernel->handle($request, $kernel::MASTER_REQUEST, false);
- Request::setTrustedProxies(array(), -1);
+ Request::setTrustedProxies([], -1);
}
- private function getHttpKernel(EventDispatcherInterface $eventDispatcher, $controller = null, RequestStack $requestStack = null, array $arguments = array())
+ private function getHttpKernel(EventDispatcherInterface $eventDispatcher, $controller = null, RequestStack $requestStack = null, array $arguments = [])
{
if (null === $controller) {
$controller = function () { return new Response('Hello'); };