diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 22:33:53 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 22:52:28 +0200 |
commit | 91b154ea24ec11f6b51e54ae08a28b877f6708ad (patch) | |
tree | ead9cf25a6ee3be8e2881f03b919c991ee2c04f5 /tests/unit | |
parent | 17860b4af160a6b4a01178cfd01fbc7f8271fccf (diff) |
remove last reference from appframework, fix routing issue
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/middleware/CORSMiddlewareTest.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/unit/middleware/CORSMiddlewareTest.php b/tests/unit/middleware/CORSMiddlewareTest.php index f6baabac7..96a50d88c 100644 --- a/tests/unit/middleware/CORSMiddlewareTest.php +++ b/tests/unit/middleware/CORSMiddlewareTest.php @@ -24,20 +24,22 @@ namespace OCA\News\Middleware; -use OCA\AppFramework\Http\Request; -use OCA\AppFramework\Http\Response; +use OCP\IRequest; +use OCP\AppFramework\Http\Response; + +use OCA\News\Utility\ControllerTestUtility; require_once(__DIR__ . "/../../classloader.php"); -class CORSMiddlewareTest extends \PHPUnit_Framework_TestCase { +class CORSMiddlewareTest extends ControllerTestUtility { /** * @API */ public function testSetCORSAPIHeader() { - $request = new Request( + $request = $this->getRequest( array('server' => array('HTTP_ORIGIN' => 'test')) ); $middleware = new CORSMiddleware($request); @@ -51,7 +53,7 @@ class CORSMiddlewareTest extends \PHPUnit_Framework_TestCase { public function testNoAPINoCORSHEADER() { - $request = new Request(); + $request = $this->getRequest(); $middleware = new CORSMiddleware($request); $response = $middleware->afterController('\OCA\News\Middleware\CORSMiddlewareTest', 'testNoAPINoCORSHEADER', @@ -65,7 +67,7 @@ class CORSMiddlewareTest extends \PHPUnit_Framework_TestCase { * @API */ public function testNoOriginHeaderNoCORSHEADER() { - $request = new Request(); + $request = $this->getRequest(); $middleware = new CORSMiddleware($request); $response = $middleware->afterController('\OCA\News\Middleware\CORSMiddlewareTest', 'testNoOriginHeaderNoCORSHEADER', |