|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * Copyright 2025 Adobe |
4 | | - * All Rights Reserved. |
| 3 | + * Copyright © Magento, Inc. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
5 | 5 | */ |
6 | 6 | declare(strict_types=1); |
7 | 7 |
|
8 | 8 | namespace Magento\GraphQl; |
9 | 9 |
|
10 | | -use Magento\Framework\App\ObjectManager; |
11 | 10 | use Magento\TestFramework\TestCase\GraphQlAbstract; |
12 | | -use Psr\Log\LoggerInterface; |
13 | 11 |
|
14 | 12 | class IntrospectionQueryTest extends GraphQlAbstract |
15 | 13 | { |
@@ -55,11 +53,7 @@ public function testIntrospectionQuery() |
55 | 53 | defaultValue |
56 | 54 | } |
57 | 55 | QUERY; |
58 | | - try { |
59 | | - $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
60 | | - } catch (\Exception $e){ |
61 | | - ObjectManager::getInstance()->get(LoggerInterface::class)->debug($e->getMessage()); |
62 | | - } |
| 56 | + $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
63 | 57 | } |
64 | 58 |
|
65 | 59 | /** |
@@ -104,11 +98,7 @@ public function testIntrospectionQueryWithOnlySchema() |
104 | 98 | defaultValue |
105 | 99 | } |
106 | 100 | QUERY; |
107 | | - try { |
108 | | - $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
109 | | - } catch (\Exception $e){ |
110 | | - ObjectManager::getInstance()->get(LoggerInterface::class)->debug($e->getMessage()); |
111 | | - } |
| 101 | + $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
112 | 102 | $response = $this->graphQlQuery($query); |
113 | 103 |
|
114 | 104 | $query |
@@ -147,11 +137,7 @@ public function testIntrospectionQueryWithOnlySchema() |
147 | 137 | defaultValue |
148 | 138 | } |
149 | 139 | QUERY; |
150 | | - try { |
151 | | - $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
152 | | - } catch (\Exception $e){ |
153 | | - ObjectManager::getInstance()->get(LoggerInterface::class)->debug($e->getMessage()); |
154 | | - } |
| 140 | + $this->assertArrayHasKey('__schema', $this->graphQlQuery($query)); |
155 | 141 | $responseFields = $this->graphQlQuery($query); |
156 | 142 | $this->assertResponseFields($response, $responseFields); |
157 | 143 | $this->assertEquals($responseFields, $response); |
@@ -183,11 +169,7 @@ public function testIntrospectionQueryWithOnlyType() |
183 | 169 | } |
184 | 170 | } |
185 | 171 | QUERY; |
186 | | - try { |
187 | | - $this->assertArrayHasKey('__type', $this->graphQlQuery($query)); |
188 | | - } catch (\Exception $e){ |
189 | | - ObjectManager::getInstance()->get(LoggerInterface::class)->debug($e->getMessage()); |
190 | | - } |
| 172 | + $this->assertArrayHasKey('__type', $this->graphQlQuery($query)); |
191 | 173 | $response = $this->graphQlQuery($query); |
192 | 174 | $this->assertNotEmpty($response['__type']['fields']); |
193 | 175 | } |
@@ -227,11 +209,7 @@ enumValues(includeDeprecated: true) { |
227 | 209 | } |
228 | 210 |
|
229 | 211 | QUERY; |
230 | | - try { |
231 | | - $response = $this->graphQlQuery($query); |
232 | | - } catch (\Exception $e){ |
233 | | - ObjectManager::getInstance()->get(LoggerInterface::class)->debug($e->getMessage()); |
234 | | - } |
| 212 | + $response = $this->graphQlQuery($query); |
235 | 213 | $this->assertArrayHasKey('__schema', $response); |
236 | 214 | $schemaResponseFields = $response['__schema']['types']; |
237 | 215 | $enumValueReasonArray = $this->getEnumValueDeprecatedReason($schemaResponseFields); |
|
0 commit comments