Skip to content

Commit 4788b7e

Browse files
committed
Add tests proving it can load annotated files
1 parent ccefb3d commit 4788b7e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/Loader/AnnotationDirectoryLoaderTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ public function testSupports()
6969
$this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified');
7070
}
7171

72+
public function testItSupportsAnyAnnotation()
73+
{
74+
$this->assertTrue($this->loader->supports(__DIR__.'/../Fixtures/even-with-not-existing-folder', 'annotation'));
75+
}
76+
77+
public function testLoadFileIfLocatedResourceIsFile()
78+
{
79+
$this->reader->expects($this->exactly(1))->method('getClassAnnotation');
80+
81+
$this->reader
82+
->expects($this->any())
83+
->method('getMethodAnnotations')
84+
->will($this->returnValue(array()))
85+
;
86+
87+
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php');
88+
}
89+
7290
private function expectAnnotationsToBeReadFrom(array $classes)
7391
{
7492
$this->reader->expects($this->exactly(count($classes)))

0 commit comments

Comments
 (0)