public function testLoad()
{
- $this->reader->expects($this->exactly(2))->method('getClassAnnotation');
+ $this->reader->expects($this->exactly(3))->method('getClassAnnotation');
$this->reader
->expects($this->any())
->will($this->returnValue(array()))
;
+ $this->reader
+ ->expects($this->any())
+ ->method('getClassAnnotations')
+ ->will($this->returnValue(array()))
+ ;
+
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses');
}
{
$this->expectAnnotationsToBeReadFrom(array(
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
+ 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass',
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\FooClass',
));
->will($this->returnValue(array()))
;
+ $this->reader
+ ->expects($this->any())
+ ->method('getClassAnnotations')
+ ->will($this->returnValue(array()))
+ ;
+
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses');
}
$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)))