• 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/GraphQl/Tests/State/Provider/ResolverProviderTest.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\Resolver\QueryItemResolverInterface;
17
use ApiPlatform\GraphQl\State\Provider\ResolverProvider;
18
use ApiPlatform\GraphQl\Tests\Fixtures\ApiResource\ChildFoo;
19
use ApiPlatform\GraphQl\Tests\Fixtures\ApiResource\ParentFoo;
20
use ApiPlatform\Metadata\GraphQl\Query;
21
use ApiPlatform\Metadata\GraphQl\QueryCollection;
22
use ApiPlatform\State\ProviderInterface;
23
use PHPUnit\Framework\TestCase;
24
use Psr\Container\ContainerInterface;
25

26
class ResolverProviderTest extends TestCase
27
{
28
    public function testProvide(): void
29
    {
30
        $res = new \stdClass();
×
NEW
31
        $operation = new QueryCollection(class: \stdClass::class, resolver: 'foo');
×
32
        $context = [];
×
33
        $decorated = $this->createMock(ProviderInterface::class);
×
34
        $resolverMock = $this->createMock(QueryItemResolverInterface::class);
×
35
        $resolverMock->expects($this->once())->method('__invoke')->willReturn($res);
×
36
        $resolverLocator = $this->createMock(ContainerInterface::class);
×
37
        $resolverLocator->expects($this->once())->method('get')->with('foo')->willReturn($resolverMock);
×
38
        $provider = new ResolverProvider($decorated, $resolverLocator);
×
39
        $this->assertEquals($res, $provider->provide($operation, [], $context));
×
40
    }
41

42
    public function testProvideInheritedClass(): void
43
    {
44
        $res = new ChildFoo();
×
45
        $operation = new Query(class: ParentFoo::class, resolver: 'foo');
×
46
        $context = [];
×
47
        $decorated = $this->createMock(ProviderInterface::class);
×
48
        $resolverMock = $this->createMock(QueryItemResolverInterface::class);
×
49
        $resolverMock->expects($this->once())->method('__invoke')->willReturn($res);
×
50
        $resolverLocator = $this->createMock(ContainerInterface::class);
×
51
        $resolverLocator->expects($this->once())->method('get')->with('foo')->willReturn($resolverMock);
×
52
        $provider = new ResolverProvider($decorated, $resolverLocator);
×
53
        $this->assertEquals($res, $provider->provide($operation, [], $context));
×
54
    }
55
}
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