summaryrefslogtreecommitdiffstats
path: root/tests/lib/appframework
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-11-10 23:30:38 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-11-19 14:53:59 +0100
commit6202ca33ba76a38b4aea8774018d661f919fa464 (patch)
treea108c8631dad790bc8c3fc175c9c330d18c54ad2 /tests/lib/appframework
parentcb3a598cdb238f9ce74dce80ef9e59cdfc531a4f (diff)
downloadnextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.tar.gz
nextcloud-server-6202ca33ba76a38b4aea8774018d661f919fa464.zip
Make remaining files extend the test base
Diffstat (limited to 'tests/lib/appframework')
-rw-r--r--tests/lib/appframework/AppTest.php4
-rw-r--r--tests/lib/appframework/controller/ApiControllerTest.php2
-rw-r--r--tests/lib/appframework/controller/ControllerTest.php4
-rw-r--r--tests/lib/appframework/db/EntityTest.php3
-rw-r--r--tests/lib/appframework/db/mappertest.php2
-rw-r--r--tests/lib/appframework/db/mappertestutility.php6
-rw-r--r--tests/lib/appframework/dependencyinjection/DIContainerTest.php3
-rw-r--r--tests/lib/appframework/http/DataResponseTest.php3
-rw-r--r--tests/lib/appframework/http/DispatcherTest.php5
-rw-r--r--tests/lib/appframework/http/DownloadResponseTest.php3
-rw-r--r--tests/lib/appframework/http/HttpTest.php4
-rw-r--r--tests/lib/appframework/http/JSONResponseTest.php3
-rw-r--r--tests/lib/appframework/http/RedirectResponseTest.php3
-rw-r--r--tests/lib/appframework/http/RequestTest.php9
-rw-r--r--tests/lib/appframework/http/ResponseTest.php3
-rw-r--r--tests/lib/appframework/http/TemplateResponseTest.php4
-rw-r--r--tests/lib/appframework/middleware/MiddlewareDispatcherTest.php5
-rw-r--r--tests/lib/appframework/middleware/MiddlewareTest.php4
-rw-r--r--tests/lib/appframework/middleware/security/CORSMiddlewareTest.php3
-rw-r--r--tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php6
-rw-r--r--tests/lib/appframework/middleware/sessionmiddlewaretest.php4
-rw-r--r--tests/lib/appframework/routing/RoutingTest.php2
-rw-r--r--tests/lib/appframework/utility/ControllerMethodReflectorTest.php2
23 files changed, 56 insertions, 31 deletions
diff --git a/tests/lib/appframework/AppTest.php b/tests/lib/appframework/AppTest.php
index 92fa4838341..bd565e9765e 100644
--- a/tests/lib/appframework/AppTest.php
+++ b/tests/lib/appframework/AppTest.php
@@ -25,7 +25,7 @@
namespace OC\AppFramework;
-class AppTest extends \PHPUnit_Framework_TestCase {
+class AppTest extends \Test\TestCase {
private $container;
private $api;
@@ -38,6 +38,8 @@ class AppTest extends \PHPUnit_Framework_TestCase {
private $controllerMethod;
protected function setUp() {
+ parent::setUp();
+
$this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array());
$this->controller = $this->getMockBuilder(
'OCP\AppFramework\Controller')
diff --git a/tests/lib/appframework/controller/ApiControllerTest.php b/tests/lib/appframework/controller/ApiControllerTest.php
index b772f540ce8..3055fbe0da8 100644
--- a/tests/lib/appframework/controller/ApiControllerTest.php
+++ b/tests/lib/appframework/controller/ApiControllerTest.php
@@ -31,7 +31,7 @@ use OCP\AppFramework\Http\TemplateResponse;
class ChildApiController extends ApiController {};
-class ApiControllerTest extends \PHPUnit_Framework_TestCase {
+class ApiControllerTest extends \Test\TestCase {
public function testCors() {
diff --git a/tests/lib/appframework/controller/ControllerTest.php b/tests/lib/appframework/controller/ControllerTest.php
index 0de94ff5b70..d186651dc23 100644
--- a/tests/lib/appframework/controller/ControllerTest.php
+++ b/tests/lib/appframework/controller/ControllerTest.php
@@ -54,7 +54,7 @@ class ChildController extends Controller {
}
};
-class ControllerTest extends \PHPUnit_Framework_TestCase {
+class ControllerTest extends \Test\TestCase {
/**
* @var Controller
@@ -63,6 +63,8 @@ class ControllerTest extends \PHPUnit_Framework_TestCase {
private $app;
protected function setUp(){
+ parent::setUp();
+
$request = new Request(
array(
'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
diff --git a/tests/lib/appframework/db/EntityTest.php b/tests/lib/appframework/db/EntityTest.php
index d98cb549422..161e11d8030 100644
--- a/tests/lib/appframework/db/EntityTest.php
+++ b/tests/lib/appframework/db/EntityTest.php
@@ -49,11 +49,12 @@ class TestEntity extends Entity {
};
-class EntityTest extends \PHPUnit_Framework_TestCase {
+class EntityTest extends \Test\TestCase {
private $entity;
protected function setUp(){
+ parent::setUp();
$this->entity = new TestEntity();
}
diff --git a/tests/lib/appframework/db/mappertest.php b/tests/lib/appframework/db/mappertest.php
index fd1acd0367e..6ad8cd86bff 100644
--- a/tests/lib/appframework/db/mappertest.php
+++ b/tests/lib/appframework/db/mappertest.php
@@ -57,7 +57,7 @@ class MapperTest extends MapperTestUtility {
*/
private $mapper;
- public function setUp(){
+ protected function setUp(){
parent::setUp();
$this->mapper = new ExampleMapper($this->db);
}
diff --git a/tests/lib/appframework/db/mappertestutility.php b/tests/lib/appframework/db/mappertestutility.php
index 0430eef2c21..ad7a67a96b1 100644
--- a/tests/lib/appframework/db/mappertestutility.php
+++ b/tests/lib/appframework/db/mappertestutility.php
@@ -28,9 +28,7 @@ namespace Test\AppFramework\Db;
/**
* Simple utility class for testing mappers
*/
-abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
-
-
+abstract class MapperTestUtility extends \Test\TestCase {
protected $db;
private $query;
private $pdoResult;
@@ -45,6 +43,8 @@ abstract class MapperTestUtility extends \PHPUnit_Framework_TestCase {
* db. After this the db can be accessed by using $this->db
*/
protected function setUp(){
+ parent::setUp();
+
$this->db = $this->getMockBuilder(
'\OCP\IDb')
->disableOriginalConstructor()
diff --git a/tests/lib/appframework/dependencyinjection/DIContainerTest.php b/tests/lib/appframework/dependencyinjection/DIContainerTest.php
index acc5c2e66d8..08e72aff984 100644
--- a/tests/lib/appframework/dependencyinjection/DIContainerTest.php
+++ b/tests/lib/appframework/dependencyinjection/DIContainerTest.php
@@ -29,12 +29,13 @@ namespace OC\AppFramework\DependencyInjection;
use \OC\AppFramework\Http\Request;
-class DIContainerTest extends \PHPUnit_Framework_TestCase {
+class DIContainerTest extends \Test\TestCase {
private $container;
private $api;
protected function setUp(){
+ parent::setUp();
$this->container = new DIContainer('name');
$this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi'));
}
diff --git a/tests/lib/appframework/http/DataResponseTest.php b/tests/lib/appframework/http/DataResponseTest.php
index 961327c978c..e91d3cefea9 100644
--- a/tests/lib/appframework/http/DataResponseTest.php
+++ b/tests/lib/appframework/http/DataResponseTest.php
@@ -29,7 +29,7 @@ use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http;
-class DataResponseTest extends \PHPUnit_Framework_TestCase {
+class DataResponseTest extends \Test\TestCase {
/**
* @var DataResponse
@@ -37,6 +37,7 @@ class DataResponseTest extends \PHPUnit_Framework_TestCase {
private $response;
protected function setUp() {
+ parent::setUp();
$this->response = new DataResponse();
}
diff --git a/tests/lib/appframework/http/DispatcherTest.php b/tests/lib/appframework/http/DispatcherTest.php
index f082ddc8b3a..f92e7161e6b 100644
--- a/tests/lib/appframework/http/DispatcherTest.php
+++ b/tests/lib/appframework/http/DispatcherTest.php
@@ -62,9 +62,7 @@ class TestController extends Controller {
}
-class DispatcherTest extends \PHPUnit_Framework_TestCase {
-
-
+class DispatcherTest extends \Test\TestCase {
private $middlewareDispatcher;
private $dispatcher;
private $controllerMethod;
@@ -75,6 +73,7 @@ class DispatcherTest extends \PHPUnit_Framework_TestCase {
private $reflector;
protected function setUp() {
+ parent::setUp();
$this->controllerMethod = 'test';
$app = $this->getMockBuilder(
diff --git a/tests/lib/appframework/http/DownloadResponseTest.php b/tests/lib/appframework/http/DownloadResponseTest.php
index ab381e5c298..5e5db2c55ec 100644
--- a/tests/lib/appframework/http/DownloadResponseTest.php
+++ b/tests/lib/appframework/http/DownloadResponseTest.php
@@ -30,7 +30,7 @@ class ChildDownloadResponse extends DownloadResponse {
};
-class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
+class DownloadResponseTest extends \Test\TestCase {
/**
* @var ChildDownloadResponse
@@ -38,6 +38,7 @@ class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
protected $response;
protected function setUp(){
+ parent::setUp();
$this->response = new ChildDownloadResponse('file', 'content');
}
diff --git a/tests/lib/appframework/http/HttpTest.php b/tests/lib/appframework/http/HttpTest.php
index a7a189c98e5..e9be3e73904 100644
--- a/tests/lib/appframework/http/HttpTest.php
+++ b/tests/lib/appframework/http/HttpTest.php
@@ -27,7 +27,7 @@ namespace OC\AppFramework\Http;
use OC\AppFramework\Http;
-class HttpTest extends \PHPUnit_Framework_TestCase {
+class HttpTest extends \Test\TestCase {
private $server;
@@ -37,6 +37,8 @@ class HttpTest extends \PHPUnit_Framework_TestCase {
private $http;
protected function setUp(){
+ parent::setUp();
+
$this->server = array();
$this->http = new Http($this->server);
}
diff --git a/tests/lib/appframework/http/JSONResponseTest.php b/tests/lib/appframework/http/JSONResponseTest.php
index 06cd3410a69..cdd8d269b41 100644
--- a/tests/lib/appframework/http/JSONResponseTest.php
+++ b/tests/lib/appframework/http/JSONResponseTest.php
@@ -30,7 +30,7 @@ namespace OC\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http;
-class JSONResponseTest extends \PHPUnit_Framework_TestCase {
+class JSONResponseTest extends \Test\TestCase {
/**
* @var JSONResponse
@@ -38,6 +38,7 @@ class JSONResponseTest extends \PHPUnit_Framework_TestCase {
private $json;
protected function setUp() {
+ parent::setUp();
$this->json = new JSONResponse();
}
diff --git a/tests/lib/appframework/http/RedirectResponseTest.php b/tests/lib/appframework/http/RedirectResponseTest.php
index e5d452f7f91..17db0c0be6c 100644
--- a/tests/lib/appframework/http/RedirectResponseTest.php
+++ b/tests/lib/appframework/http/RedirectResponseTest.php
@@ -27,7 +27,7 @@ namespace OCP\AppFramework\Http;
use OCP\AppFramework\Http;
-class RedirectResponseTest extends \PHPUnit_Framework_TestCase {
+class RedirectResponseTest extends \Test\TestCase {
/**
* @var RedirectResponse
@@ -35,6 +35,7 @@ class RedirectResponseTest extends \PHPUnit_Framework_TestCase {
protected $response;
protected function setUp(){
+ parent::setUp();
$this->response = new RedirectResponse('/url');
}
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index 58828d17bb2..caa22c84415 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -10,9 +10,11 @@ namespace OC\AppFramework\Http;
global $data;
-class RequestTest extends \PHPUnit_Framework_TestCase {
+class RequestTest extends \Test\TestCase {
+
+ protected function setUp() {
+ parent::setUp();
- public function setUp() {
require_once __DIR__ . '/requeststream.php';
if (in_array('fakeinput', stream_get_wrappers())) {
stream_wrapper_unregister('fakeinput');
@@ -21,8 +23,9 @@ class RequestTest extends \PHPUnit_Framework_TestCase {
$this->stream = 'fakeinput://data';
}
- public function tearDown() {
+ protected function tearDown() {
stream_wrapper_unregister('fakeinput');
+ parent::tearDown();
}
public function testRequestAccessors() {
diff --git a/tests/lib/appframework/http/ResponseTest.php b/tests/lib/appframework/http/ResponseTest.php
index b1dddd9ebc7..04e19fdaf71 100644
--- a/tests/lib/appframework/http/ResponseTest.php
+++ b/tests/lib/appframework/http/ResponseTest.php
@@ -29,7 +29,7 @@ use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http;
-class ResponseTest extends \PHPUnit_Framework_TestCase {
+class ResponseTest extends \Test\TestCase {
/**
* @var \OCP\AppFramework\Http\Response
@@ -37,6 +37,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase {
private $childResponse;
protected function setUp(){
+ parent::setUp();
$this->childResponse = new Response();
}
diff --git a/tests/lib/appframework/http/TemplateResponseTest.php b/tests/lib/appframework/http/TemplateResponseTest.php
index afdcf322b85..2ec57f8979a 100644
--- a/tests/lib/appframework/http/TemplateResponseTest.php
+++ b/tests/lib/appframework/http/TemplateResponseTest.php
@@ -28,7 +28,7 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http;
-class TemplateResponseTest extends \PHPUnit_Framework_TestCase {
+class TemplateResponseTest extends \Test\TestCase {
/**
* @var \OCP\AppFramework\Http\TemplateResponse
@@ -41,6 +41,8 @@ class TemplateResponseTest extends \PHPUnit_Framework_TestCase {
private $api;
protected function setUp() {
+ parent::setUp();
+
$this->api = $this->getMock('OC\AppFramework\Core\API',
array('getAppName'), array('test'));
$this->api->expects($this->any())
diff --git a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php
index b1e221aab99..be8765afd39 100644
--- a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php
+++ b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php
@@ -100,7 +100,7 @@ class TestMiddleware extends Middleware {
}
-class MiddlewareDispatcherTest extends \PHPUnit_Framework_TestCase {
+class MiddlewareDispatcherTest extends \Test\TestCase {
public $exception;
public $response;
@@ -113,8 +113,9 @@ class MiddlewareDispatcherTest extends \PHPUnit_Framework_TestCase {
*/
private $dispatcher;
+ protected function setUp() {
+ parent::setUp();
- public function setUp() {
$this->dispatcher = new MiddlewareDispatcher();
$this->controller = $this->getControllerMock();
$this->method = 'method';
diff --git a/tests/lib/appframework/middleware/MiddlewareTest.php b/tests/lib/appframework/middleware/MiddlewareTest.php
index 9d952f61573..b41ec33eb15 100644
--- a/tests/lib/appframework/middleware/MiddlewareTest.php
+++ b/tests/lib/appframework/middleware/MiddlewareTest.php
@@ -31,7 +31,7 @@ use OCP\AppFramework\Middleware;
class ChildMiddleware extends Middleware {};
-class MiddlewareTest extends \PHPUnit_Framework_TestCase {
+class MiddlewareTest extends \Test\TestCase {
/**
* @var Middleware
@@ -42,6 +42,8 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase {
private $api;
protected function setUp(){
+ parent::setUp();
+
$this->middleware = new ChildMiddleware();
$this->api = $this->getMockBuilder(
diff --git a/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php b/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php
index 79cd3b278af..b4bbcce5ad7 100644
--- a/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php
+++ b/tests/lib/appframework/middleware/security/CORSMiddlewareTest.php
@@ -18,11 +18,12 @@ use OC\AppFramework\Utility\ControllerMethodReflector;
use OCP\AppFramework\Http\Response;
-class CORSMiddlewareTest extends \PHPUnit_Framework_TestCase {
+class CORSMiddlewareTest extends \Test\TestCase {
private $reflector;
protected function setUp() {
+ parent::setUp();
$this->reflector = new ControllerMethodReflector();
}
diff --git a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
index cc7704f4d1a..a8925403a95 100644
--- a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
+++ b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
@@ -31,7 +31,7 @@ use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\JSONResponse;
-class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
+class SecurityMiddlewareTest extends \Test\TestCase {
private $middleware;
private $controller;
@@ -43,7 +43,9 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
private $navigationManager;
private $urlGenerator;
- public function setUp() {
+ protected function setUp() {
+ parent::setUp();
+
$this->controller = $this->getMockBuilder('OCP\AppFramework\Controller')
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/appframework/middleware/sessionmiddlewaretest.php b/tests/lib/appframework/middleware/sessionmiddlewaretest.php
index 13e558bf21a..344b555ec3c 100644
--- a/tests/lib/appframework/middleware/sessionmiddlewaretest.php
+++ b/tests/lib/appframework/middleware/sessionmiddlewaretest.php
@@ -18,7 +18,7 @@ use OC\AppFramework\Utility\ControllerMethodReflector;
use OCP\AppFramework\Http\Response;
-class SessionMiddlewareTest extends \PHPUnit_Framework_TestCase {
+class SessionMiddlewareTest extends \Test\TestCase {
/**
* @var ControllerMethodReflector
@@ -31,6 +31,8 @@ class SessionMiddlewareTest extends \PHPUnit_Framework_TestCase {
private $request;
protected function setUp() {
+ parent::setUp();
+
$this->request = new Request();
$this->reflector = new ControllerMethodReflector();
}
diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php
index a1d9a51a3c8..276307680af 100644
--- a/tests/lib/appframework/routing/RoutingTest.php
+++ b/tests/lib/appframework/routing/RoutingTest.php
@@ -6,7 +6,7 @@ use OC\AppFramework\DependencyInjection\DIContainer;
use OC\AppFramework\routing\RouteConfig;
-class RoutingTest extends \PHPUnit_Framework_TestCase
+class RoutingTest extends \Test\TestCase
{
public function testSimpleRoute()
diff --git a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
index 8939a203edb..cd6bd57da4c 100644
--- a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
+++ b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
@@ -25,7 +25,7 @@
namespace OC\AppFramework\Utility;
-class ControllerMethodReflectorTest extends \PHPUnit_Framework_TestCase {
+class ControllerMethodReflectorTest extends \Test\TestCase {
/**