File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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 \Tests \GraphQl ;
15+
16+ use ApiPlatform \GraphQl \Executor ;
17+ use PHPUnit \Framework \TestCase ;
18+ use GraphQL \Validator \DocumentValidator ;
19+ use GraphQL \Validator \Rules \DisableIntrospection ;
20+
21+ /**
22+ * @author Alan Poulain <contact@alanpoulain.eu>
23+ */
24+ class ExecutorTest extends TestCase
25+ {
26+ public function testEnableIntrospectionQuery (): void
27+ {
28+ $ executor = new Executor (true );
29+
30+ $ expected = new DisableIntrospection (DisableIntrospection::ENABLED );
31+
32+ $ this ->assertIsObject ($ executor );
33+ $ this ->assertEquals ($ expected , DocumentValidator::getRule ('DisableIntrospection ' ));
34+ }
35+
36+ public function testDisableIntrospectionQuery (): void
37+ {
38+ $ executor = new Executor (false );
39+
40+ $ expected = new DisableIntrospection (DisableIntrospection::DISABLED );
41+
42+ $ this ->assertIsObject ($ executor );
43+ $ this ->assertEquals ($ expected , DocumentValidator::getRule ('DisableIntrospection ' ));
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments