From 7083a7e1fd64744c02b9237430620d9ce7f18207 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 12 Apr 2014 00:20:37 +0200 Subject: add unittest for method annotation reader --- tests/unit/utility/MethodAnnotationReaderTest.php | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/unit/utility/MethodAnnotationReaderTest.php diff --git a/tests/unit/utility/MethodAnnotationReaderTest.php b/tests/unit/utility/MethodAnnotationReaderTest.php new file mode 100644 index 000000000..d41224ffa --- /dev/null +++ b/tests/unit/utility/MethodAnnotationReaderTest.php @@ -0,0 +1,58 @@ +. + * + */ + + +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 -- cgit v1.2.3