Fix namespaces in AppFramework tests

This commit is contained in:
Joas Schilling 2016-05-18 18:40:34 +02:00
parent 765782445a
commit 9eade36ae5
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
26 changed files with 58 additions and 38 deletions

View File

@ -22,8 +22,9 @@
*/
namespace OC\AppFramework;
namespace Test\AppFramework;
use OC\AppFramework\App;
use OCP\AppFramework\Http\Response;

View File

@ -22,9 +22,10 @@
*/
namespace OCP\AppFramework;
namespace Test\AppFramework\Controller;
use OC\AppFramework\Http\Request;
use OCP\AppFramework\ApiController;
class ChildApiController extends ApiController {};

View File

@ -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;

View File

@ -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 {}

View File

@ -21,7 +21,10 @@
*
*/
namespace OCP\AppFramework\Db;
namespace Test\AppFramework\Db;
use OCP\AppFramework\Db\Entity;
/**

View File

@ -24,11 +24,11 @@
*/
namespace OC\AppFramework\DependencyInjection;
namespace Test\AppFramework\DependencyInjection;
use \OC\AppFramework\Http\Request;
class DIContainerTest extends \Test\TestCase {
private $container;

View File

@ -7,7 +7,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\ContentSecurityPolicy;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;

View File

@ -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;

View File

@ -22,9 +22,11 @@
*/
namespace OCP\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\DownloadResponse;
class ChildDownloadResponse extends DownloadResponse {
};

View File

@ -7,7 +7,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\EmptyContentSecurityPolicy;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OC\AppFramework\Http;

View File

@ -24,7 +24,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\OCSResponse;

View File

@ -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 {

View File

@ -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;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\Response;

View File

@ -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;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework;
namespace Test\AppFramework\Middleware;
use OC\AppFramework\Http\Request;
use OC\AppFramework\Middleware\MiddlewareDispatcher;

View File

@ -22,7 +22,7 @@
*/
namespace OC\AppFramework;
namespace Test\AppFramework\Middleware;
use OC\AppFramework\Http\Request;
use OCP\AppFramework\Middleware;

View File

@ -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;

View File

@ -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;

View File

@ -10,7 +10,7 @@
*/
namespace OC\AppFramework\Middleware\Security;
namespace Test\AppFramework\Middleware;
use OC\AppFramework\Http\Request;
use OC\AppFramework\Middleware\SessionMiddleware;

View File

@ -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
{

View File

@ -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'));
}