diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-18 18:40:34 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-18 18:57:45 +0200 |
commit | 9eade36ae5ac8d0fd9e002c78494f3ad19f919ab (patch) | |
tree | b0f8d8bd374f22f5cfde35bcdfc87cf6b1c29262 /tests/lib/appframework | |
parent | 765782445a24fb1b239f2a3cd5c7b239ae4f6455 (diff) | |
download | nextcloud-server-9eade36ae5ac8d0fd9e002c78494f3ad19f919ab.tar.gz nextcloud-server-9eade36ae5ac8d0fd9e002c78494f3ad19f919ab.zip |
Fix namespaces in AppFramework tests
Diffstat (limited to 'tests/lib/appframework')
26 files changed, 58 insertions, 38 deletions
diff --git a/tests/lib/appframework/AppTest.php b/tests/lib/appframework/AppTest.php index 3d41d6590aa..7288e686d52 100644 --- a/tests/lib/appframework/AppTest.php +++ b/tests/lib/appframework/AppTest.php @@ -22,8 +22,9 @@ */ -namespace OC\AppFramework; +namespace Test\AppFramework; +use OC\AppFramework\App; use OCP\AppFramework\Http\Response; diff --git a/tests/lib/appframework/controller/ApiControllerTest.php b/tests/lib/appframework/controller/ApiControllerTest.php index 137e5950f67..783eecf93e5 100644 --- a/tests/lib/appframework/controller/ApiControllerTest.php +++ b/tests/lib/appframework/controller/ApiControllerTest.php @@ -22,9 +22,10 @@ */ -namespace OCP\AppFramework; +namespace Test\AppFramework\Controller; use OC\AppFramework\Http\Request; +use OCP\AppFramework\ApiController; class ChildApiController extends ApiController {}; diff --git a/tests/lib/appframework/controller/ControllerTest.php b/tests/lib/appframework/controller/ControllerTest.php index 1493c0c3175..521799a46ce 100644 --- a/tests/lib/appframework/controller/ControllerTest.php +++ b/tests/lib/appframework/controller/ControllerTest.php @@ -22,9 +22,10 @@ */ -namespace OCP\AppFramework; +namespace Test\AppFramework\Controller; use OC\AppFramework\Http\Request; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\DataResponse; diff --git a/tests/lib/appframework/controller/OCSControllerTest.php b/tests/lib/appframework/controller/OCSControllerTest.php index 92b092cf0e9..f69740d4496 100644 --- a/tests/lib/appframework/controller/OCSControllerTest.php +++ b/tests/lib/appframework/controller/OCSControllerTest.php @@ -22,10 +22,11 @@ */ -namespace OCP\AppFramework; +namespace Test\AppFramework\Controller; use OC\AppFramework\Http\Request; use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\OCSController; class ChildOCSController extends OCSController {} diff --git a/tests/lib/appframework/db/EntityTest.php b/tests/lib/appframework/db/EntityTest.php index 161e11d8030..e1a3d7533be 100644 --- a/tests/lib/appframework/db/EntityTest.php +++ b/tests/lib/appframework/db/EntityTest.php @@ -21,7 +21,10 @@ * */ -namespace OCP\AppFramework\Db; +namespace Test\AppFramework\Db; + + +use OCP\AppFramework\Db\Entity; /** diff --git a/tests/lib/appframework/dependencyinjection/DIContainerTest.php b/tests/lib/appframework/dependencyinjection/DIContainerTest.php index fc15b5a44ee..5aa000fa25a 100644 --- a/tests/lib/appframework/dependencyinjection/DIContainerTest.php +++ b/tests/lib/appframework/dependencyinjection/DIContainerTest.php @@ -24,10 +24,10 @@ */ -namespace OC\AppFramework\DependencyInjection; +namespace Test\AppFramework\DependencyInjection; -use \OC\AppFramework\Http\Request; +use \OC\AppFramework\Http\Request; class DIContainerTest extends \Test\TestCase { diff --git a/tests/lib/appframework/http/ContentSecurityPolicyTest.php b/tests/lib/appframework/http/ContentSecurityPolicyTest.php index adf03185e9f..82f2b3873b7 100644 --- a/tests/lib/appframework/http/ContentSecurityPolicyTest.php +++ b/tests/lib/appframework/http/ContentSecurityPolicyTest.php @@ -7,7 +7,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http; use OCP\AppFramework\Http\ContentSecurityPolicy; diff --git a/tests/lib/appframework/http/DataResponseTest.php b/tests/lib/appframework/http/DataResponseTest.php index e3d5689d54c..cde553cdf5f 100644 --- a/tests/lib/appframework/http/DataResponseTest.php +++ b/tests/lib/appframework/http/DataResponseTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; diff --git a/tests/lib/appframework/http/DispatcherTest.php b/tests/lib/appframework/http/DispatcherTest.php index 02c86df8e72..6df6f7fa7fe 100644 --- a/tests/lib/appframework/http/DispatcherTest.php +++ b/tests/lib/appframework/http/DispatcherTest.php @@ -22,8 +22,10 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; +use OC\AppFramework\Http\Dispatcher; +use OC\AppFramework\Http\Request; use OC\AppFramework\Utility\ControllerMethodReflector; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; diff --git a/tests/lib/appframework/http/DownloadResponseTest.php b/tests/lib/appframework/http/DownloadResponseTest.php index 5e5db2c55ec..07c932b2725 100644 --- a/tests/lib/appframework/http/DownloadResponseTest.php +++ b/tests/lib/appframework/http/DownloadResponseTest.php @@ -22,9 +22,11 @@ */ -namespace OCP\AppFramework\Http; +namespace Test\AppFramework\Http; +use OCP\AppFramework\Http\DownloadResponse; + class ChildDownloadResponse extends DownloadResponse { }; diff --git a/tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php b/tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php index 0d0f92de819..248c3d808d2 100644 --- a/tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php +++ b/tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php @@ -7,7 +7,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http; use OCP\AppFramework\Http\EmptyContentSecurityPolicy; diff --git a/tests/lib/appframework/http/HttpTest.php b/tests/lib/appframework/http/HttpTest.php index 4bcc8305db4..66256d1a86f 100644 --- a/tests/lib/appframework/http/HttpTest.php +++ b/tests/lib/appframework/http/HttpTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OC\AppFramework\Http; diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php index a98f5fc894a..23a55e7eee8 100644 --- a/tests/lib/appframework/http/JSONResponseTest.php +++ b/tests/lib/appframework/http/JSONResponseTest.php @@ -24,7 +24,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; diff --git a/tests/lib/appframework/http/OCSResponseTest.php b/tests/lib/appframework/http/OCSResponseTest.php index 1ca3e330bad..adac66a231c 100644 --- a/tests/lib/appframework/http/OCSResponseTest.php +++ b/tests/lib/appframework/http/OCSResponseTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\OCSResponse; diff --git a/tests/lib/appframework/http/RedirectResponseTest.php b/tests/lib/appframework/http/RedirectResponseTest.php index 723f6600c55..5ef82a1221d 100644 --- a/tests/lib/appframework/http/RedirectResponseTest.php +++ b/tests/lib/appframework/http/RedirectResponseTest.php @@ -22,9 +22,10 @@ */ -namespace OCP\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\RedirectResponse; class RedirectResponseTest extends \Test\TestCase { diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php index 3f1d09c2a93..5b960908991 100644 --- a/tests/lib/appframework/http/RequestTest.php +++ b/tests/lib/appframework/http/RequestTest.php @@ -8,8 +8,9 @@ * See the COPYING-README file. */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; +use OC\AppFramework\Http\Request; use OC\Security\CSRF\CsrfToken; use OC\Security\CSRF\CsrfTokenManager; use OCP\Security\ISecureRandom; diff --git a/tests/lib/appframework/http/ResponseTest.php b/tests/lib/appframework/http/ResponseTest.php index f845f02d984..0c582f8f6ea 100644 --- a/tests/lib/appframework/http/ResponseTest.php +++ b/tests/lib/appframework/http/ResponseTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\Response; diff --git a/tests/lib/appframework/http/StreamResponseTest.php b/tests/lib/appframework/http/StreamResponseTest.php index 4c47ecfbd6c..1f761d6b89c 100644 --- a/tests/lib/appframework/http/StreamResponseTest.php +++ b/tests/lib/appframework/http/StreamResponseTest.php @@ -22,10 +22,11 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\StreamResponse; +use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\Http; diff --git a/tests/lib/appframework/http/TemplateResponseTest.php b/tests/lib/appframework/http/TemplateResponseTest.php index 2ec57f8979a..87fb6864f78 100644 --- a/tests/lib/appframework/http/TemplateResponseTest.php +++ b/tests/lib/appframework/http/TemplateResponseTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Http; +namespace Test\AppFramework\Http; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http; diff --git a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php index a8731525798..f81aca106d6 100644 --- a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework; +namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; use OC\AppFramework\Middleware\MiddlewareDispatcher; diff --git a/tests/lib/appframework/middleware/MiddlewareTest.php b/tests/lib/appframework/middleware/MiddlewareTest.php index 33f04e1383d..013403a9a4a 100644 --- a/tests/lib/appframework/middleware/MiddlewareTest.php +++ b/tests/lib/appframework/middleware/MiddlewareTest.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework; +namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; use OCP\AppFramework\Middleware; diff --git a/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php b/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php index cf5f97a046f..8e53c9202cf 100644 --- a/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php +++ b/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php @@ -10,9 +10,10 @@ */ -namespace OC\AppFramework\Middleware\Security; +namespace Test\AppFramework\Middleware\Security; use OC\AppFramework\Http\Request; +use OC\AppFramework\Middleware\Security\CORSMiddleware; use OC\AppFramework\Utility\ControllerMethodReflector; use OC\AppFramework\Middleware\Security\Exceptions\SecurityException; use OCP\AppFramework\Http; diff --git a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php index f70308dc731..8cdba76d835 100644 --- a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php +++ b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php @@ -22,7 +22,7 @@ -namespace OC\AppFramework\Middleware\Security; +namespace Test\AppFramework\Middleware\Security; use OC\AppFramework\Http; use OC\AppFramework\Http\Request; @@ -31,6 +31,7 @@ use OC\AppFramework\Middleware\Security\Exceptions\CrossSiteRequestForgeryExcept use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException; use OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException; use OC\AppFramework\Middleware\Security\Exceptions\SecurityException; +use OC\AppFramework\Middleware\Security\SecurityMiddleware; use OC\AppFramework\Utility\ControllerMethodReflector; use OC\Security\CSP\ContentSecurityPolicy; use OCP\AppFramework\Http\RedirectResponse; diff --git a/tests/lib/appframework/middleware/sessionmiddlewaretest.php b/tests/lib/appframework/middleware/sessionmiddlewaretest.php index 11c1600f515..17fcc1904c1 100644 --- a/tests/lib/appframework/middleware/sessionmiddlewaretest.php +++ b/tests/lib/appframework/middleware/sessionmiddlewaretest.php @@ -10,7 +10,7 @@ */ -namespace OC\AppFramework\Middleware\Security; +namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; use OC\AppFramework\Middleware\SessionMiddleware; diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php index 3ceab1aac48..326c156af98 100644 --- a/tests/lib/appframework/routing/RoutingTest.php +++ b/tests/lib/appframework/routing/RoutingTest.php @@ -1,8 +1,10 @@ <?php -namespace OC\AppFramework\Routing; +namespace Test\AppFramework\Routing; use OC\AppFramework\DependencyInjection\DIContainer; +use OC\AppFramework\Routing\RouteActionHandler; +use OC\AppFramework\Routing\RouteConfig; class RoutingTest extends \Test\TestCase { diff --git a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php index c643c362a9c..92d767e9987 100644 --- a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php +++ b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php @@ -22,9 +22,11 @@ */ -namespace OC\AppFramework\Utility; +namespace Test\AppFramework\Utility; +use OC\AppFramework\Utility\ControllerMethodReflector; + class BaseController { /** @@ -66,7 +68,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadAnnotation(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'testReadAnnotation' ); @@ -81,7 +83,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadAnnotationNoLowercase(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'testReadAnnotationNoLowercase' ); @@ -97,7 +99,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadTypeIntAnnotations(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'testReadTypeIntAnnotations' ); @@ -117,7 +119,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadTypeIntAnnotationsScalarTypes(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'arguments3' ); @@ -135,7 +137,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadTypeDoubleAnnotations(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'testReadTypeDoubleAnnotations' ); @@ -149,7 +151,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReadTypeWhitespaceAnnotations(){ $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'testReadTypeWhitespaceAnnotations' ); @@ -161,7 +163,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReflectParameters() { $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'arguments' ); @@ -173,7 +175,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testReflectParameters2() { $reader = new ControllerMethodReflector(); $reader->reflect( - '\OC\AppFramework\Utility\ControllerMethodReflectorTest', + '\Test\AppFramework\Utility\ControllerMethodReflectorTest', 'arguments2' ); @@ -183,7 +185,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testInheritance() { $reader = new ControllerMethodReflector(); - $reader->reflect('OC\AppFramework\Utility\EndController', 'test'); + $reader->reflect('Test\AppFramework\Utility\EndController', 'test'); $this->assertTrue($reader->hasAnnotation('Annotation')); } @@ -191,7 +193,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testInheritanceOverride() { $reader = new ControllerMethodReflector(); - $reader->reflect('OC\AppFramework\Utility\EndController', 'test2'); + $reader->reflect('Test\AppFramework\Utility\EndController', 'test2'); $this->assertTrue($reader->hasAnnotation('NoAnnotation')); $this->assertFalse($reader->hasAnnotation('Annotation')); @@ -200,7 +202,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase { public function testInheritanceOverrideNoDocblock() { $reader = new ControllerMethodReflector(); - $reader->reflect('OC\AppFramework\Utility\EndController', 'test3'); + $reader->reflect('Test\AppFramework\Utility\EndController', 'test3'); $this->assertFalse($reader->hasAnnotation('Annotation')); } |