• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 13855495414

14 Mar 2025 11:19AM UTC coverage: 8.526% (-15.0%) from 23.51%
13855495414

Pull #7017

github

web-flow
Merge 0d3b24a16 into bf09616cf
Pull Request #7017: feat(metadata) Load external PHP file resources

22 of 78 new or added lines in 10 files covered. (28.21%)

36 existing lines in 2 files now uncovered.

13401 of 157170 relevant lines covered (8.53%)

22.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Metadata/Tests/Extractor/PhpFileResourceExtractorTest.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace ApiPlatform\Metadata\Tests\Extractor;
6

7
use ApiPlatform\Metadata\ApiResource;
8
use ApiPlatform\Metadata\Extractor\PhpFileResourceExtractor;
9
use PHPUnit\Framework\TestCase;
10

11
final class PhpFileResourceExtractorTest extends TestCase
12
{
13
    public function testItGetsResourcesFromPhpFileThatReturnsAnApiResource(): void
14
    {
NEW
15
        $extractor = new PhpFileResourceExtractor([__DIR__ . '/php/valid_php_file.php']);
×
16

NEW
17
        $expectedResource = new ApiResource(shortName: 'dummy');
×
18

NEW
19
        $this->assertEquals([$expectedResource], $extractor->getResources());
×
20
    }
21

22
    public function testItExcludesResourcesFromPhpFileThatDoesNotReturnAnApiResource(): void
23
    {
NEW
24
        $extractor = new PhpFileResourceExtractor([__DIR__ . '/php/invalid_php_file.php']);
×
25

NEW
26
        $this->assertEquals([], $extractor->getResources());
×
27
    }
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc