File tree Expand file tree Collapse file tree 3 files changed +51
-1
lines changed
lib/Doctrine/Common/Persistence/Mapping/Driver
tests/Doctrine/Tests/Common/Persistence/Mapping Expand file tree Collapse file tree 3 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,11 @@ public function getAllClassNames()
219219 );
220220
221221 foreach ($ iterator as $ file ) {
222- $ sourceFile = realpath ($ file [0 ]);
222+ $ sourceFile = $ file [0 ];
223+
224+ if ( ! preg_match ('(^phar:)i ' , $ sourceFile )) {
225+ $ sourceFile = realpath ($ sourceFile );
226+ }
223227
224228 foreach ($ this ->excludePaths as $ excludePath ) {
225229 $ exclude = str_replace ('\\' , '/ ' , realpath ($ excludePath ));
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Doctrine \Tests \Common \Persistence \Mapping ;
4+
5+ use Doctrine \Common \Annotations \AnnotationReader ;
6+ use Doctrine \Common \Persistence \Mapping \Driver \AnnotationDriver ;
7+ use Doctrine \Common \Persistence \Mapping \ClassMetadata ;
8+
9+ class AnnotationDriverTest extends \PHPUnit_Framework_TestCase
10+ {
11+ public function testGetAllClassNames ()
12+ {
13+ $ reader = new AnnotationReader ();
14+ $ driver = new SimpleAnnotationDriver ($ reader , array (__DIR__ . '/_files/annotation ' ));
15+
16+ $ classes = $ driver ->getAllClassNames ();
17+
18+ $ this ->assertEquals (array ('Doctrine\TestClass ' ), $ classes );
19+ }
20+ }
21+
22+ class SimpleAnnotationDriver extends AnnotationDriver
23+ {
24+ protected $ entityAnnotationClasses = array ('Doctrine\Entity ' => true );
25+
26+ public function loadMetadataForClass ($ className , ClassMetadata $ metadata )
27+ {
28+ }
29+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Doctrine ;
4+
5+ /**
6+ * @Doctrine\Entity
7+ */
8+ class TestClass
9+ {
10+ }
11+
12+ /**
13+ * @Annotation
14+ */
15+ class Entity
16+ {
17+ }
You can’t perform that action at this time.
0 commit comments