diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 00:20:37 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-12 00:20:37 +0200 |
commit | 7083a7e1fd64744c02b9237430620d9ce7f18207 (patch) | |
tree | 3162ab4e820bc792d93a3e4fadd4470f35bbf53f /tests | |
parent | 81550ec42cc5d96e1e4c03741b287033b62ff971 (diff) |
add unittest for method annotation reader
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/utility/MethodAnnotationReaderTest.php | 58 |
1 files changed, 58 insertions, 0 deletions
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 @@ +<?php + +/** + * ownCloud - News + * + * @author Bernhard Posselt + * @copyright 2012 Bernhard Posselt dev@bernhard-posselt.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + + +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 |