File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ protected function extractPath(string $path): void
4343 $ property ->setValue ($ resource , $ resolvedValue );
4444 }
4545
46- $ this ->resources = [ $ resource] ;
46+ $ this ->resources [] = $ resource ;
4747 }
4848
4949 /**
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ final class PhpFileResourceExtractorTest extends TestCase
2121{
2222 public function testItGetsResourcesFromPhpFileThatReturnsAnApiResource (): void
2323 {
24- $ extractor = new PhpFileResourceExtractor ([__DIR__ .'/php/valid_php_file.php ' ]);
24+ $ extractor = new PhpFileResourceExtractor ([__DIR__ .'/php/valid_php_file.php ' , __DIR__ . ' /php/another_valid_php_file.php ' ]);
2525
26- $ expectedResource = new ApiResource (shortName: 'dummy ' );
26+ $ expectedResources = [ new ApiResource (shortName: 'dummy ' ), new ApiResource (shortName: ' another_dummy ' )] ;
2727
28- $ this ->assertEquals ([ $ expectedResource ] , $ extractor ->getResources ());
28+ $ this ->assertEquals ($ expectedResources , $ extractor ->getResources ());
2929 }
3030
3131 public function testItExcludesResourcesFromPhpFileThatDoesNotReturnAnApiResource (): void
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the API Platform project.
5+ *
6+ * (c) Kévin Dunglas <dunglas@gmail.com>
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ declare (strict_types=1 );
13+
14+ use ApiPlatform \Metadata \ApiResource ;
15+
16+ return new ApiResource (shortName: 'another_dummy ' );
You can’t perform that action at this time.
0 commit comments