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

api-platform / core / 16414261225

21 Jul 2025 10:14AM UTC coverage: 21.806% (-0.2%) from 22.039%
16414261225

Pull #7307

github

web-flow
Merge 92df6bf50 into d3b4b7b40
Pull Request #7307: Use class-string param type for Metadata::getClass

0 of 191 new or added lines in 19 files covered. (0.0%)

44 existing lines in 2 files now uncovered.

11408 of 52317 relevant lines covered (21.81%)

11.64 hits per line

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

0.0
/src/Metadata/Tests/Resource/Factory/MainControllerResourceMetadataCollectionFactoryTest.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\Resource\Factory;
15

16
use ApiPlatform\Metadata\ApiResource;
17
use ApiPlatform\Metadata\Get;
18
use ApiPlatform\Metadata\HttpOperation;
19
use ApiPlatform\Metadata\Resource\Factory\MainControllerResourceMetadataCollectionFactory;
20
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
21
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
22
use PHPUnit\Framework\TestCase;
23

24
class MainControllerResourceMetadataCollectionFactoryTest extends TestCase
25
{
26
    public function testCreate(): void
27
    {
28
        $decorated = $this->createMock(ResourceMetadataCollectionFactoryInterface::class);
×
29
        $decorated->method('create')->willReturn(new ResourceMetadataCollection('Dummy', [
×
30
            new ApiResource(
×
31
                shortName: 'AttributeResource',
×
NEW
32
                class: \stdClass::class,
×
33
                operations: [
×
NEW
34
                    'get' => new Get(shortName: 'AttributeResource', class: \stdClass::class),
×
35
                ]
×
36
            ),
×
37
        ]));
×
38

NEW
39
        $apiResource = (new MainControllerResourceMetadataCollectionFactory($decorated))->create(\stdClass::class);
×
40
        $operation = $apiResource->getOperation();
×
41
        $this->assertInstanceOf(HttpOperation::class, $operation);
×
42
        $this->assertEquals($operation->getController(), 'api_platform.symfony.main_controller');
×
43
    }
44
}
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