From 770fa761b8bf8452ff17a2036ca8413e74935a3d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 9 Feb 2015 11:41:48 +0100 Subject: Respect `mod_unique_id` and refactor `OC_Request::getRequestId` When `mod_unique_id` is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs. Testplan: - [ ] When `mod_unique_id` is enabled the request ID equals the one generated by `mod_unique_id`. - [ ] When `mod_unique_id` is not available the request ID is a 20 character long random string - [ ] The generated Id is stable over the lifespan of one request Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI. Fixes https://github.com/owncloud/core/issues/13366 --- .../lib/appframework/middleware/MiddlewareDispatcherTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/lib/appframework/middleware/MiddlewareDispatcherTest.php') diff --git a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php index be8765afd39..078543c7b59 100644 --- a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php @@ -126,8 +126,16 @@ class MiddlewareDispatcherTest extends \Test\TestCase { private function getControllerMock(){ - return $this->getMock('OCP\AppFramework\Controller', array('method'), - array('app', new Request(array('method' => 'GET')))); + return $this->getMock( + 'OCP\AppFramework\Controller', + ['method'], + ['app', + new Request( + ['method' => 'GET'], + $this->getMockBuilder('\OCP\Security\ISecureRandom')->getMock() + ) + ] + ); } -- cgit v1.2.3