diff options
Diffstat (limited to 'tests/lib/AppFramework/Http')
-rw-r--r-- | tests/lib/AppFramework/Http/DispatcherTest.php | 8 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/RedirectResponseTest.php | 2 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/RequestTest.php | 24 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/ResponseTest.php | 8 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/StreamResponseTest.php | 8 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/TemplateResponseTest.php | 10 |
6 files changed, 30 insertions, 30 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index d6af034e95e..bb6f68c40bb 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -51,7 +51,7 @@ class TestController extends Controller { * @return array */ public function exec($int, $bool, $test=4, $test2=1) { - $this->registerResponder('text', function($in) { + $this->registerResponder('text', function ($in) { return new JSONResponse(['text' => $in]); }); return [$int, $bool, $test, $test2]; @@ -231,7 +231,7 @@ class DispatcherTest extends \Test\TestCase { } - public function testHeadersAndOutputAreReturned(){ + public function testHeadersAndOutputAreReturned() { $out = 'yo'; $httpHeaders = 'Http'; $responseHeaders = ['hell' => 'yeah']; @@ -281,12 +281,12 @@ class DispatcherTest extends \Test\TestCase { ->method('beforeController'); $this->middlewareDispatcher->expects($this->once()) ->method('afterController') - ->willReturnCallback(function($a, $b, $in) { + ->willReturnCallback(function ($a, $b, $in) { return $in; }); $this->middlewareDispatcher->expects($this->once()) ->method('beforeOutput') - ->willReturnCallback(function($a, $b, $in) { + ->willReturnCallback(function ($a, $b, $in) { return $in; }); } diff --git a/tests/lib/AppFramework/Http/RedirectResponseTest.php b/tests/lib/AppFramework/Http/RedirectResponseTest.php index fc24f323c6a..b211df1846e 100644 --- a/tests/lib/AppFramework/Http/RedirectResponseTest.php +++ b/tests/lib/AppFramework/Http/RedirectResponseTest.php @@ -47,7 +47,7 @@ class RedirectResponseTest extends \Test\TestCase { } - public function testGetRedirectUrl(){ + public function testGetRedirectUrl() { $this->assertEquals('/url', $this->response->getRedirectUrl()); } diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index 8f7c26cc952..e5a3e88d98e 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -716,7 +716,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolWithProtoValid() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } @@ -757,7 +757,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolWithHttpsServerValueOn() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { return $default; }); @@ -778,7 +778,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolWithHttpsServerValueOff() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { return $default; }); @@ -799,7 +799,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolWithHttpsServerValueEmpty() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { return $default; }); @@ -820,7 +820,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolDefault() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { return $default; }); @@ -837,7 +837,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerProtocolBehindLoadBalancers() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } @@ -1059,7 +1059,7 @@ class RequestTest extends \Test\TestCase { public function testInsecureServerHostHttpFromForwardedHeaderSingle() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } @@ -1088,7 +1088,7 @@ class RequestTest extends \Test\TestCase { public function testInsecureServerHostHttpFromForwardedHeaderStacked() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } @@ -1117,7 +1117,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerHostWithOverwriteHost() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'overwritecondaddr') { return ''; } else if ($key === 'overwritehost') { @@ -1141,7 +1141,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerHostWithTrustedDomain() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } else if ($key === 'trusted_domains') { @@ -1170,7 +1170,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerHostWithUntrustedDomain() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } else if ($key === 'trusted_domains') { @@ -1199,7 +1199,7 @@ class RequestTest extends \Test\TestCase { public function testGetServerHostWithNoTrustedDomain() { $this->config ->method('getSystemValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { if ($key === 'trusted_proxies') { return ['1.2.3.4']; } diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index 0a2dc84d411..7ff12b7fa67 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -40,7 +40,7 @@ class ResponseTest extends \Test\TestCase { } - public function testAddHeader(){ + public function testAddHeader() { $this->childResponse->addHeader(' hello ', 'world'); $headers = $this->childResponse->getHeaders(); $this->assertEquals('world', $headers['hello']); @@ -87,14 +87,14 @@ class ResponseTest extends \Test\TestCase { $this->assertEquals(new Http\EmptyContentSecurityPolicy(), $this->childResponse->getContentSecurityPolicy()); } - public function testAddHeaderValueNullDeletesIt(){ + public function testAddHeaderValueNullDeletesIt() { $this->childResponse->addHeader('hello', 'world'); $this->childResponse->addHeader('hello', null); $this->assertEquals(3, count($this->childResponse->getHeaders())); } - public function testCacheHeadersAreDisabledByDefault(){ + public function testCacheHeadersAreDisabledByDefault() { $headers = $this->childResponse->getHeaders(); $this->assertEquals('no-cache, no-store, must-revalidate', $headers['Cache-Control']); } @@ -186,7 +186,7 @@ class ResponseTest extends \Test\TestCase { } - public function testRenderReturnNullByDefault(){ + public function testRenderReturnNullByDefault() { $this->assertEquals(null, $this->childResponse->render()); } diff --git a/tests/lib/AppFramework/Http/StreamResponseTest.php b/tests/lib/AppFramework/Http/StreamResponseTest.php index 6257769d927..fb4eb5dc91c 100644 --- a/tests/lib/AppFramework/Http/StreamResponseTest.php +++ b/tests/lib/AppFramework/Http/StreamResponseTest.php @@ -39,7 +39,7 @@ class StreamResponseTest extends \Test\TestCase { ->getMock(); } - public function testOutputNotModified(){ + public function testOutputNotModified() { $path = __FILE__; $this->output->expects($this->once()) ->method('getHttpResponseCode') @@ -51,7 +51,7 @@ class StreamResponseTest extends \Test\TestCase { $response->callback($this->output); } - public function testOutputOk(){ + public function testOutputOk() { $path = __FILE__; $this->output->expects($this->once()) ->method('getHttpResponseCode') @@ -65,7 +65,7 @@ class StreamResponseTest extends \Test\TestCase { $response->callback($this->output); } - public function testOutputNotFound(){ + public function testOutputNotFound() { $path = __FILE__ . 'test'; $this->output->expects($this->once()) ->method('getHttpResponseCode') @@ -80,7 +80,7 @@ class StreamResponseTest extends \Test\TestCase { $response->callback($this->output); } - public function testOutputReadFileError(){ + public function testOutputReadFileError() { $path = __FILE__; $this->output->expects($this->once()) ->method('getHttpResponseCode') diff --git a/tests/lib/AppFramework/Http/TemplateResponseTest.php b/tests/lib/AppFramework/Http/TemplateResponseTest.php index af5b428cf86..0faa78998cb 100644 --- a/tests/lib/AppFramework/Http/TemplateResponseTest.php +++ b/tests/lib/AppFramework/Http/TemplateResponseTest.php @@ -40,7 +40,7 @@ class TemplateResponseTest extends \Test\TestCase { } - public function testSetParamsConstructor(){ + public function testSetParamsConstructor() { $params = ['hi' => 'yo']; $this->tpl = new TemplateResponse('app', 'home', $params); @@ -48,7 +48,7 @@ class TemplateResponseTest extends \Test\TestCase { } - public function testSetRenderAsConstructor(){ + public function testSetRenderAsConstructor() { $renderAs = 'myrender'; $this->tpl = new TemplateResponse('app', 'home', [], $renderAs); @@ -56,7 +56,7 @@ class TemplateResponseTest extends \Test\TestCase { } - public function testSetParams(){ + public function testSetParams() { $params = ['hi' => 'yo']; $this->tpl->setParams($params); @@ -64,11 +64,11 @@ class TemplateResponseTest extends \Test\TestCase { } - public function testGetTemplateName(){ + public function testGetTemplateName() { $this->assertEquals('home', $this->tpl->getTemplateName()); } - public function testGetRenderAs(){ + public function testGetRenderAs() { $render = 'myrender'; $this->tpl->renderAs($render); $this->assertEquals($render, $this->tpl->getRenderAs()); |