|
27 | 27 | use OxidEsales\GraphQL\Base\Service\Authorization; |
28 | 28 | use OxidEsales\GraphQL\Base\Service\ModuleConfiguration; |
29 | 29 | use OxidEsales\GraphQL\Base\Service\Token; |
| 30 | +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; |
30 | 31 | use Psr\Log\LoggerInterface; |
31 | 32 | use ReflectionClass; |
32 | 33 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
33 | 34 |
|
| 35 | +#[AllowMockObjectsWithoutExpectations] |
34 | 36 | abstract class TestCase extends IntegrationTestCase |
35 | 37 | { |
36 | 38 | protected static $queryResult; |
@@ -126,25 +128,21 @@ protected function setAuthToken(string $token): void |
126 | 128 | $tokenService = static::$container->get(Token::class); |
127 | 129 | $refClass = new ReflectionClass(Token::class); |
128 | 130 | $prop = $refClass->getProperty('token'); |
129 | | - $prop->setAccessible(true); |
130 | 131 | $prop->setValue($tokenService, $authToken); |
131 | 132 |
|
132 | 133 | $authentication = static::$container->get(Authentication::class); |
133 | 134 | $refClass = new ReflectionClass(Authentication::class); |
134 | 135 | $prop = $refClass->getProperty('tokenService'); |
135 | | - $prop->setAccessible(true); |
136 | 136 | $prop->setValue($authentication, $tokenService); |
137 | 137 |
|
138 | 138 | $authorization = static::$container->get(Authorization::class); |
139 | 139 | $refClass = new ReflectionClass(Authorization::class); |
140 | 140 | $prop = $refClass->getProperty('tokenService'); |
141 | | - $prop->setAccessible(true); |
142 | 141 | $prop->setValue($authorization, $tokenService); |
143 | 142 |
|
144 | 143 | $schema = static::$container->get(SchemaFactory::class); |
145 | 144 | $refClass = new ReflectionClass(SchemaFactory::class); |
146 | 145 | $prop = $refClass->getProperty('schema'); |
147 | | - $prop->setAccessible(true); |
148 | 146 | $prop->setValue($schema, null); |
149 | 147 | } |
150 | 148 |
|
@@ -217,7 +215,6 @@ protected function uploadFile( |
217 | 215 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
218 | 216 |
|
219 | 217 | $response = curl_exec($ch); |
220 | | - curl_close($ch); |
221 | 218 |
|
222 | 219 | return json_decode($response, true) ?: []; |
223 | 220 | } |
|
0 commit comments