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

api-platform / core / 6067528200

04 Sep 2023 12:12AM UTC coverage: 36.875% (-21.9%) from 58.794%
6067528200

Pull #5791

github

web-flow
Merge 64157e578 into d09cfc9d2
Pull Request #5791: fix: strip down any sql function name

3096 of 3096 new or added lines in 205 files covered. (100.0%)

9926 of 26918 relevant lines covered (36.87%)

6.5 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',
×
32
                class: 'Dummy',
×
33
                operations: [
×
34
                    'get' => new Get(shortName: 'AttributeResource', class: 'Dummy'),
×
35
                ]
×
36
            ),
×
37
        ]));
×
38

39
        $apiResource = (new MainControllerResourceMetadataCollectionFactory($decorated))->create('Dummy');
×
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

© 2026 Coveralls, Inc