X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Frouting%2FTests%2FLoader%2FAnnotationDirectoryLoaderTest.php;fp=vendor%2Fsymfony%2Frouting%2FTests%2FLoader%2FAnnotationDirectoryLoaderTest.php;h=8a6668e0c2beb1b1e756e812d261138c1ae030f6;hp=8d832f0c1c03d9fb5435b643a8550e460a1ec7d3;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php b/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php index 8d832f0c1..8a6668e0c 100644 --- a/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php +++ b/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php @@ -29,7 +29,7 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest public function testLoad() { - $this->reader->expects($this->exactly(2))->method('getClassAnnotation'); + $this->reader->expects($this->exactly(3))->method('getClassAnnotation'); $this->reader ->expects($this->any()) @@ -37,6 +37,12 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest ->will($this->returnValue(array())) ; + $this->reader + ->expects($this->any()) + ->method('getClassAnnotations') + ->will($this->returnValue(array())) + ; + $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses'); } @@ -44,6 +50,7 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest { $this->expectAnnotationsToBeReadFrom(array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', + 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass', 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\FooClass', )); @@ -53,6 +60,12 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest ->will($this->returnValue(array())) ; + $this->reader + ->expects($this->any()) + ->method('getClassAnnotations') + ->will($this->returnValue(array())) + ; + $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses'); } @@ -67,6 +80,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)))