Browse Source

Fix namespaces in AppFramework tests

tags/v9.1.0beta1
Joas Schilling 8 years ago
parent
commit
9eade36ae5
No account linked to committer's email address
26 changed files with 58 additions and 38 deletions
  1. 2
    1
      tests/lib/appframework/AppTest.php
  2. 2
    1
      tests/lib/appframework/controller/ApiControllerTest.php
  3. 2
    1
      tests/lib/appframework/controller/ControllerTest.php
  4. 2
    1
      tests/lib/appframework/controller/OCSControllerTest.php
  5. 4
    1
      tests/lib/appframework/db/EntityTest.php
  6. 2
    2
      tests/lib/appframework/dependencyinjection/DIContainerTest.php
  7. 1
    1
      tests/lib/appframework/http/ContentSecurityPolicyTest.php
  8. 1
    1
      tests/lib/appframework/http/DataResponseTest.php
  9. 3
    1
      tests/lib/appframework/http/DispatcherTest.php
  10. 3
    1
      tests/lib/appframework/http/DownloadResponseTest.php
  11. 1
    1
      tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php
  12. 1
    1
      tests/lib/appframework/http/HttpTest.php
  13. 1
    1
      tests/lib/appframework/http/JSONResponseTest.php
  14. 1
    1
      tests/lib/appframework/http/OCSResponseTest.php
  15. 2
    1
      tests/lib/appframework/http/RedirectResponseTest.php
  16. 2
    1
      tests/lib/appframework/http/RequestTest.php
  17. 1
    1
      tests/lib/appframework/http/ResponseTest.php
  18. 2
    1
      tests/lib/appframework/http/StreamResponseTest.php
  19. 1
    1
      tests/lib/appframework/http/TemplateResponseTest.php
  20. 1
    1
      tests/lib/appframework/middleware/MiddlewareDispatcherTest.php
  21. 1
    1
      tests/lib/appframework/middleware/MiddlewareTest.php
  22. 2
    1
      tests/lib/appframework/middleware/security/CORSMiddlewareTest.php
  23. 2
    1
      tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
  24. 1
    1
      tests/lib/appframework/middleware/sessionmiddlewaretest.php
  25. 3
    1
      tests/lib/appframework/routing/RoutingTest.php
  26. 14
    12
      tests/lib/appframework/utility/ControllerMethodReflectorTest.php

+ 2
- 1
tests/lib/appframework/AppTest.php View File

@@ -22,8 +22,9 @@
*/


namespace OC\AppFramework;
namespace Test\AppFramework;

use OC\AppFramework\App;
use OCP\AppFramework\Http\Response;



+ 2
- 1
tests/lib/appframework/controller/ApiControllerTest.php 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 {};

+ 2
- 1
tests/lib/appframework/controller/ControllerTest.php 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;

+ 2
- 1
tests/lib/appframework/controller/OCSControllerTest.php 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 {}

+ 4
- 1
tests/lib/appframework/db/EntityTest.php View File

@@ -21,7 +21,10 @@
*
*/

namespace OCP\AppFramework\Db;
namespace Test\AppFramework\Db;


use OCP\AppFramework\Db\Entity;


/**

+ 2
- 2
tests/lib/appframework/dependencyinjection/DIContainerTest.php View File

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


+ 1
- 1
tests/lib/appframework/http/ContentSecurityPolicyTest.php View File

@@ -7,7 +7,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;

use OCP\AppFramework\Http;
use OCP\AppFramework\Http\ContentSecurityPolicy;

+ 1
- 1
tests/lib/appframework/http/DataResponseTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;


use OCP\AppFramework\Http\DataResponse;

+ 3
- 1
tests/lib/appframework/http/DispatcherTest.php 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;

+ 3
- 1
tests/lib/appframework/http/DownloadResponseTest.php View File

@@ -22,9 +22,11 @@
*/


namespace OCP\AppFramework\Http;
namespace Test\AppFramework\Http;


use OCP\AppFramework\Http\DownloadResponse;

class ChildDownloadResponse extends DownloadResponse {

};

+ 1
- 1
tests/lib/appframework/http/EmptyContentSecurityPolicyTest.php View File

@@ -7,7 +7,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;

use OCP\AppFramework\Http;
use OCP\AppFramework\Http\EmptyContentSecurityPolicy;

+ 1
- 1
tests/lib/appframework/http/HttpTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;

use OC\AppFramework\Http;


+ 1
- 1
tests/lib/appframework/http/JSONResponseTest.php View File

@@ -24,7 +24,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;


use OCP\AppFramework\Http\JSONResponse;

+ 1
- 1
tests/lib/appframework/http/OCSResponseTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;


use OCP\AppFramework\Http\OCSResponse;

+ 2
- 1
tests/lib/appframework/http/RedirectResponseTest.php 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 {

+ 2
- 1
tests/lib/appframework/http/RequestTest.php 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;

+ 1
- 1
tests/lib/appframework/http/ResponseTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;


use OCP\AppFramework\Http\Response;

+ 2
- 1
tests/lib/appframework/http/StreamResponseTest.php 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;



+ 1
- 1
tests/lib/appframework/http/TemplateResponseTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework\Http;
namespace Test\AppFramework\Http;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http;

+ 1
- 1
tests/lib/appframework/middleware/MiddlewareDispatcherTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework;
namespace Test\AppFramework\Middleware;

use OC\AppFramework\Http\Request;
use OC\AppFramework\Middleware\MiddlewareDispatcher;

+ 1
- 1
tests/lib/appframework/middleware/MiddlewareTest.php View File

@@ -22,7 +22,7 @@
*/


namespace OC\AppFramework;
namespace Test\AppFramework\Middleware;

use OC\AppFramework\Http\Request;
use OCP\AppFramework\Middleware;

+ 2
- 1
tests/lib/appframework/middleware/security/CORSMiddlewareTest.php 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;

+ 2
- 1
tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php 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;

+ 1
- 1
tests/lib/appframework/middleware/sessionmiddlewaretest.php 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;

+ 3
- 1
tests/lib/appframework/routing/RoutingTest.php 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
{

+ 14
- 12
tests/lib/appframework/utility/ControllerMethodReflectorTest.php 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'));
}

Loading…
Cancel
Save