Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / common / tests / Doctrine / Tests / Common / Annotations / Ticket / DCOM55Test.php
1 <?php
2
3 namespace Doctrine\Tests\Common\Annotations\Ticket;
4
5 use Doctrine\Tests\Common\Annotations\Fixtures\Controller;
6
7 /**
8  * @group
9  */
10 class DCOM55Test extends \PHPUnit_Framework_TestCase
11 {
12     /**
13      * @expectedException Doctrine\Common\Annotations\AnnotationException
14      * @expectedExceptionMessage [Semantical Error] The class "Doctrine\Tests\Common\Annotations\Fixtures\Controller" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Doctrine\Tests\Common\Annotations\Fixtures\Controller". If it is indeed no annotation, then you need to add @IgnoreAnnotation("Controller") to the _class_ doc comment of class Doctrine\Tests\Common\Annotations\Ticket\Dummy.
15      */
16     public function testIssue()
17     {
18         $class = new \ReflectionClass(__NAMESPACE__ . '\\Dummy');
19         $reader = new \Doctrine\Common\Annotations\AnnotationReader();
20         $reader->getClassAnnotations($class);
21     }
22
23     public function testAnnotation()
24     {
25         $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Consumer');
26         $reader = new \Doctrine\Common\Annotations\AnnotationReader();
27         $annots = $reader->getClassAnnotations($class);
28
29         $this->assertEquals(1, count($annots));
30         $this->assertInstanceOf(__NAMESPACE__.'\\DCOM55Annotation', $annots[0]);
31     }
32
33     public function testParseAnnotationDocblocks()
34     {
35         $class = new \ReflectionClass(__NAMESPACE__ . '\\DCOM55Annotation');
36         $reader = new \Doctrine\Common\Annotations\AnnotationReader();
37         $annots = $reader->getClassAnnotations($class);
38
39         $this->assertEquals(0, count($annots));
40     }
41 }
42
43 /**
44  * @Controller
45  */
46 class Dummy
47 {
48
49 }
50
51 /**
52  * @Annotation
53  */
54 class DCOM55Annotation
55 {
56
57 }
58
59 /**
60  * @DCOM55Annotation
61  */
62 class DCOM55Consumer
63 {
64
65 }