Fix namespaces in AppFramework tests
This commit is contained in:
parent
765782445a
commit
9eade36ae5
|
@ -22,8 +22,9 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework;
|
||||
namespace Test\AppFramework;
|
||||
|
||||
use OC\AppFramework\App;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
|
||||
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OCP\AppFramework;
|
||||
namespace Test\AppFramework\Controller;
|
||||
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OCP\AppFramework\ApiController;
|
||||
|
||||
|
||||
class ChildApiController extends ApiController {};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -21,7 +21,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCP\AppFramework\Db;
|
||||
namespace Test\AppFramework\Db;
|
||||
|
||||
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\DependencyInjection;
|
||||
namespace Test\AppFramework\DependencyInjection;
|
||||
|
||||
|
||||
use \OC\AppFramework\Http\Request;
|
||||
|
||||
|
||||
class DIContainerTest extends \Test\TestCase {
|
||||
|
||||
private $container;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OCP\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
|
||||
use OCP\AppFramework\Http\DownloadResponse;
|
||||
|
||||
class ChildDownloadResponse extends DownloadResponse {
|
||||
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\EmptyContentSecurityPolicy;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
use OC\AppFramework\Http;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
|
||||
use OCP\AppFramework\Http\OCSResponse;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
|
||||
use OCP\AppFramework\Http\Response;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Http;
|
||||
namespace Test\AppFramework\Http;
|
||||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Http;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework;
|
||||
namespace Test\AppFramework\Middleware;
|
||||
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OC\AppFramework\Middleware\MiddlewareDispatcher;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework;
|
||||
namespace Test\AppFramework\Middleware;
|
||||
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OCP\AppFramework\Middleware;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace OC\AppFramework\Middleware\Security;
|
||||
namespace Test\AppFramework\Middleware;
|
||||
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OC\AppFramework\Middleware\SessionMiddleware;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue