From 39d1eeb1199b137c9d0f805250d6b73bacf53eb5 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 13 May 2014 00:43:54 +0200 Subject: [PATCH] remove more tests of classes that are now in core --- tests/unit/middleware/CORSMiddlewareTest.php | 69 ------------------- .../utility/MethodAnnotationReaderTest.php | 48 ------------- 2 files changed, 117 deletions(-) delete mode 100644 tests/unit/middleware/CORSMiddlewareTest.php delete mode 100644 tests/unit/utility/MethodAnnotationReaderTest.php diff --git a/tests/unit/middleware/CORSMiddlewareTest.php b/tests/unit/middleware/CORSMiddlewareTest.php deleted file mode 100644 index ccc0420ca..000000000 --- a/tests/unit/middleware/CORSMiddlewareTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - - -namespace OCA\News\Middleware; - -use OCP\IRequest; -use OCP\AppFramework\Http\Response; - -use OCA\News\Utility\ControllerTestUtility; - -require_once(__DIR__ . "/../../classloader.php"); - - -class CORSMiddlewareTest extends ControllerTestUtility { - - - /** - * @API - */ - public function testSetCORSAPIHeader() { - $request = $this->getRequest( - array('server' => array('HTTP_ORIGIN' => 'test')) - ); - $middleware = new CORSMiddleware($request); - $response = $middleware->afterController('\OCA\News\Middleware\CORSMiddlewareTest', - 'testSetCORSAPIHeader', - new Response()); - $headers = $response->getHeaders(); - - $this->assertEquals('test', $headers['Access-Control-Allow-Origin']); - } - - - public function testNoAPINoCORSHEADER() { - $request = $this->getRequest(); - $middleware = new CORSMiddleware($request); - $response = $middleware->afterController('\OCA\News\Middleware\CORSMiddlewareTest', - 'testNoAPINoCORSHEADER', - new Response()); - $headers = $response->getHeaders(); - $this->assertFalse(array_key_exists('Access-Control-Allow-Origin', $headers)); - } - - - /** - * @API - */ - public function testNoOriginHeaderNoCORSHEADER() { - $request = $this->getRequest(); - $middleware = new CORSMiddleware($request); - $response = $middleware->afterController('\OCA\News\Middleware\CORSMiddlewareTest', - 'testNoOriginHeaderNoCORSHEADER', - new Response()); - $headers = $response->getHeaders(); - $this->assertFalse(array_key_exists('Access-Control-Allow-Origin', $headers)); - } - -} diff --git a/tests/unit/utility/MethodAnnotationReaderTest.php b/tests/unit/utility/MethodAnnotationReaderTest.php deleted file mode 100644 index 57d6e921e..000000000 --- a/tests/unit/utility/MethodAnnotationReaderTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - - -namespace OCA\News\Utility; - - -require_once(__DIR__ . "/../../classloader.php"); - - -class MethodAnnotationReaderTest extends \PHPUnit_Framework_TestCase { - - - /** - * @Annotation - */ - public function testReadAnnotation(){ - $reader = new MethodAnnotationReader('\OCA\News\Utility\MethodAnnotationReaderTest', - 'testReadAnnotation'); - - $this->assertTrue($reader->hasAnnotation('Annotation')); - } - - - /** - * @Annotation - * @param test - */ - public function testReadAnnotationNoLowercase(){ - $reader = new MethodAnnotationReader('\OCA\News\Utility\MethodAnnotationReaderTest', - 'testReadAnnotationNoLowercase'); - - $this->assertTrue($reader->hasAnnotation('Annotation')); - $this->assertFalse($reader->hasAnnotation('param')); - } - - -} \ No newline at end of file