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

api-platform / core / 13203378522

07 Feb 2025 03:56PM UTC coverage: 8.501% (+0.7%) from 7.837%
13203378522

push

github

soyuka
Merge 4.1

111 of 490 new or added lines in 51 files covered. (22.65%)

5590 existing lines in 163 files now uncovered.

13345 of 156987 relevant lines covered (8.5%)

22.88 hits per line

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

0.0
/src/GraphQl/Tests/ExecutorTest.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;
15

16
use ApiPlatform\GraphQl\Executor;
17
use GraphQL\Validator\DocumentValidator;
18
use GraphQL\Validator\Rules\DisableIntrospection;
19
use GraphQL\Validator\Rules\QueryComplexity;
20
use GraphQL\Validator\Rules\QueryDepth;
21
use PHPUnit\Framework\TestCase;
22

23
/**
24
 * @author Julien Verger <julien.verger@gmail.com>
25
 */
26
class ExecutorTest extends TestCase
27
{
28
    public function testEnableIntrospectionQuery(): void
29
    {
30
        $executor = new Executor(true);
×
31

UNCOV
32
        $expected = new DisableIntrospection(DisableIntrospection::DISABLED);
×
UNCOV
33
        $this->assertEquals($expected, DocumentValidator::getRule(DisableIntrospection::class));
×
34
    }
35

36
    public function testDisableIntrospectionQuery(): void
37
    {
38
        $executor = new Executor(false);
×
39

UNCOV
40
        $expected = new DisableIntrospection(DisableIntrospection::ENABLED);
×
UNCOV
41
        $this->assertEquals($expected, DocumentValidator::getRule(DisableIntrospection::class));
×
42
    }
43

44
    public function testChangeValueOfMaxQueryDepth(): void
45
    {
UNCOV
46
        $executor = new Executor(true, 20);
×
47

UNCOV
48
        $expected = new QueryComplexity(20);
×
UNCOV
49
        $this->assertEquals($expected, DocumentValidator::getRule(QueryComplexity::class));
×
50
    }
51

52
    public function testChangeValueOfMaxQueryComplexity(): void
53
    {
UNCOV
54
        $executor = new Executor(true, maxQueryDepth: 20);
×
55

UNCOV
56
        $expected = new QueryDepth(20);
×
UNCOV
57
        $this->assertEquals($expected, DocumentValidator::getRule(QueryDepth::class));
×
58
    }
59
}
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