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

api-platform / core / 15437993803

04 Jun 2025 08:54AM UTC coverage: 21.876% (+0.03%) from 21.851%
15437993803

push

github

web-flow
fix(metadata): append php file resource extractor (#7193)

0 of 5 new or added lines in 3 files covered. (0.0%)

11394 of 52085 relevant lines covered (21.88%)

20.97 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
/*
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
namespace ApiPlatform\Metadata\Tests\Extractor;
15

16
use ApiPlatform\Metadata\ApiResource;
17
use ApiPlatform\Metadata\Extractor\PhpFileResourceExtractor;
18
use PHPUnit\Framework\TestCase;
19

20
final class PhpFileResourceExtractorTest extends TestCase
21
{
22
    public function testItGetsResourcesFromPhpFileThatReturnsAnApiResource(): void
23
    {
NEW
24
        $extractor = new PhpFileResourceExtractor([__DIR__.'/php/valid_php_file.php', __DIR__.'/php/another_valid_php_file.php']);
×
25

NEW
26
        $expectedResources = [new ApiResource(shortName: 'dummy'), new ApiResource(shortName: 'another_dummy')];
×
27

NEW
28
        $this->assertEquals($expectedResources, $extractor->getResources());
×
29
    }
30

31
    public function testItExcludesResourcesFromPhpFileThatDoesNotReturnAnApiResource(): void
32
    {
33
        $extractor = new PhpFileResourceExtractor([__DIR__.'/php/invalid_php_file.php']);
×
34

35
        $this->assertEquals([], $extractor->getResources());
×
36
    }
37
}
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

© 2025 Coveralls, Inc