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
43
43
$ property ->setValue ($ resource , $ resolvedValue );
44
44
}
45
45
46
- $ this ->resources = [ $ resource] ;
46
+ $ this ->resources [] = $ resource ;
47
47
}
48
48
49
49
/**
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ final class PhpFileResourceExtractorTest extends TestCase
21
21
{
22
22
public function testItGetsResourcesFromPhpFileThatReturnsAnApiResource (): void
23
23
{
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 ' ]);
25
25
26
- $ expectedResource = new ApiResource (shortName: 'dummy ' );
26
+ $ expectedResources = [ new ApiResource (shortName: 'dummy ' ), new ApiResource (shortName: ' another_dummy ' )] ;
27
27
28
- $ this ->assertEquals ([ $ expectedResource ] , $ extractor ->getResources ());
28
+ $ this ->assertEquals ($ expectedResources , $ extractor ->getResources ());
29
29
}
30
30
31
31
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 <[email protected] >
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