summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php')
-rw-r--r--tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
index 69dd6d16226..5f0517016dd 100644
--- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
+++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
@@ -60,7 +60,7 @@ class TestMiddleware extends Middleware {
$this->beforeControllerThrowsEx = $beforeControllerThrowsEx;
}
- public function beforeController($controller, $methodName){
+ public function beforeController($controller, $methodName) {
self::$beforeControllerCalled++;
$this->beforeControllerOrder = self::$beforeControllerCalled;
$this->controller = $controller;
@@ -70,7 +70,7 @@ class TestMiddleware extends Middleware {
}
}
- public function afterException($controller, $methodName, \Exception $exception){
+ public function afterException($controller, $methodName, \Exception $exception) {
self::$afterExceptionCalled++;
$this->afterExceptionOrder = self::$afterExceptionCalled;
$this->controller = $controller;
@@ -79,7 +79,7 @@ class TestMiddleware extends Middleware {
parent::afterException($controller, $methodName, $exception);
}
- public function afterController($controller, $methodName, Response $response){
+ public function afterController($controller, $methodName, Response $response) {
self::$afterControllerCalled++;
$this->afterControllerOrder = self::$afterControllerCalled;
$this->controller = $controller;
@@ -88,7 +88,7 @@ class TestMiddleware extends Middleware {
return parent::afterController($controller, $methodName, $response);
}
- public function beforeOutput($controller, $methodName, $output){
+ public function beforeOutput($controller, $methodName, $output) {
self::$beforeOutputCalled++;
$this->beforeOutputOrder = self::$beforeOutputCalled;
$this->controller = $controller;
@@ -124,7 +124,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- private function getControllerMock(){
+ private function getControllerMock() {
return $this->getMockBuilder('OCP\AppFramework\Controller')
->setMethods(['method'])
->setConstructorArgs(['app',
@@ -137,14 +137,14 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- private function getMiddleware($beforeControllerThrowsEx=false){
+ private function getMiddleware($beforeControllerThrowsEx=false) {
$m1 = new TestMiddleware($beforeControllerThrowsEx);
$this->dispatcher->registerMiddleware($m1);
return $m1;
}
- public function testAfterExceptionShouldReturnResponseOfMiddleware(){
+ public function testAfterExceptionShouldReturnResponseOfMiddleware() {
$response = new Response();
$m1 = $this->getMockBuilder('\OCP\AppFramework\Middleware')
->setMethods(['afterException', 'beforeController'])
@@ -167,7 +167,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionShouldThrowAgainWhenNotHandled(){
+ public function testAfterExceptionShouldThrowAgainWhenNotHandled() {
$m1 = new TestMiddleware(false);
$m2 = new TestMiddleware(true);
@@ -180,7 +180,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeControllerCorrectArguments(){
+ public function testBeforeControllerCorrectArguments() {
$m1 = $this->getMiddleware();
$this->dispatcher->beforeController($this->controller, $this->method);
@@ -189,7 +189,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterControllerCorrectArguments(){
+ public function testAfterControllerCorrectArguments() {
$m1 = $this->getMiddleware();
$this->dispatcher->afterController($this->controller, $this->method, $this->response);
@@ -200,7 +200,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionCorrectArguments(){
+ public function testAfterExceptionCorrectArguments() {
$m1 = $this->getMiddleware();
$this->expectException(\Exception::class);
@@ -214,7 +214,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeOutputCorrectArguments(){
+ public function testBeforeOutputCorrectArguments() {
$m1 = $this->getMiddleware();
$this->dispatcher->beforeOutput($this->controller, $this->method, $this->out);
@@ -225,7 +225,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeControllerOrder(){
+ public function testBeforeControllerOrder() {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -235,7 +235,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
$this->assertEquals(2, $m2->beforeControllerOrder);
}
- public function testAfterControllerOrder(){
+ public function testAfterControllerOrder() {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -246,7 +246,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionOrder(){
+ public function testAfterExceptionOrder() {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -259,7 +259,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeOutputOrder(){
+ public function testBeforeOutputOrder() {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -270,7 +270,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares(){
+ public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares() {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware(true);
$m3 = $this->getMockBuilder('\OCP\AppFramework\Middleware')->getMock();