Add tests proving it can load annotated files

This commit is contained in:
Samuel ROZE 2017-11-24 10:32:00 +00:00
parent 5998e9d7b5
commit f4999d8af0
No known key found for this signature in database
GPG Key ID: 835426F55A19FB84

View File

@ -69,6 +69,24 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest
$this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified');
}
public function testItSupportsAnyAnnotation()
{
$this->assertTrue($this->loader->supports(__DIR__.'/../Fixtures/even-with-not-existing-folder', 'annotation'));
}
public function testLoadFileIfLocatedResourceIsFile()
{
$this->reader->expects($this->exactly(1))->method('getClassAnnotation');
$this->reader
->expects($this->any())
->method('getMethodAnnotations')
->will($this->returnValue(array()))
;
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php');
}
private function expectAnnotationsToBeReadFrom(array $classes)
{
$this->reader->expects($this->exactly(count($classes)))