• 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/GraphQl/Tests/State/Provider/ReadProviderTest.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\GraphQl\Tests\State\Provider;
15

16
use ApiPlatform\GraphQl\Serializer\SerializerContextBuilderInterface;
17
use ApiPlatform\GraphQl\State\Provider\ReadProvider;
18
use ApiPlatform\Metadata\GraphQl\Query;
19
use ApiPlatform\Metadata\GraphQl\QueryCollection;
20
use ApiPlatform\Metadata\IriConverterInterface;
21
use ApiPlatform\State\ProviderInterface;
22
use GraphQL\Type\Definition\ResolveInfo;
23
use PHPUnit\Framework\TestCase;
24

25
class ReadProviderTest extends TestCase
26
{
27
    public function testProvide(): void
28
    {
29
        $context = ['args' => ['id' => '/dummy/1']];
×
30
        $operation = new Query(class: 'dummy');
×
31
        $decorated = $this->createMock(ProviderInterface::class);
×
32
        $iriConverter = $this->createMock(IriConverterInterface::class);
×
33
        $iriConverter->expects($this->once())->method('getResourceFromIri')->with('/dummy/1');
×
34
        $serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
×
35
        $provider = new ReadProvider($decorated, $iriConverter, $serializerContextBuilder, '.');
×
36
        $provider->provide($operation, [], $context);
×
37
    }
38

39
    public function testProvideCollection(): void
40
    {
41
        $info = $this->createMock(ResolveInfo::class);
×
42
        $info->fieldName = '';
×
43
        $context = ['root_class' => 'dummy', 'source' => [], 'info' => $info, 'filters' => []];
×
44
        $operation = new QueryCollection(class: 'dummy');
×
45
        $decorated = $this->createMock(ProviderInterface::class);
×
46
        $decorated->expects($this->once())->method('provide')->with($operation, [], ['a'] + $context);
×
47
        $iriConverter = $this->createMock(IriConverterInterface::class);
×
48
        $serializerContextBuilder = $this->createMock(SerializerContextBuilderInterface::class);
×
49
        $serializerContextBuilder->expects($this->once())->method('create')->willReturn(['a']);
×
50
        $provider = new ReadProvider($decorated, $iriConverter, $serializerContextBuilder, '.');
×
51
        $provider->provide($operation, [], $context);
×
52
    }
53
}
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