Skip to content

Commit 38007aa

Browse files
authored
test(symfony): missing constant rename MAIN_REQUEST (#6105)
1 parent 2aed3c1 commit 38007aa

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ parameters:
3333
- src/Serializer/CacheableSupportsMethodInterface.php
3434
- tests/Hal/Serializer/ItemNormalizerTest.php
3535
- tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php
36+
- src/Symfony/Bundle/ArgumentResolver/CompatibleValueResolverInterface.php
3637
earlyTerminatingMethodCalls:
3738
PHPUnit\Framework\Constraint\Constraint:
3839
- fail
@@ -95,3 +96,4 @@ parameters:
9596
# Backward compatibility
9697
- '#Call to method hasCacheableSupportsMethod\(\) on an unknown class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface\.#'
9798
- '#Class Symfony\\Component\\Serializer\\Normalizer\\CacheableSupportsMethodInterface not found\.#'
99+
- '#Access to undefined constant Symfony\\Component\\HttpKernel\\HttpKernelInterface::MASTER_REQUEST\.#'

tests/HttpCache/EventListener/AddTagsListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function testAddTagsWithXKey(): void
209209
$event = new ResponseEvent(
210210
$this->prophesize(HttpKernelInterface::class)->reveal(),
211211
new Request([], [], ['_resources' => ['/foo' => '/foo', '/bar' => '/bar'], '_api_resource_class' => Dummy::class, '_api_operation_name' => 'get']),
212-
HttpKernelInterface::MASTER_REQUEST,
212+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
213213
$response
214214
);
215215

@@ -239,7 +239,7 @@ public function testAddTagsWithoutHeader(): void
239239
$event = new ResponseEvent(
240240
$this->prophesize(HttpKernelInterface::class)->reveal(),
241241
new Request([], [], ['_resources' => ['/foo' => '/foo', '/bar' => '/bar'], '_api_resource_class' => Dummy::class, '_api_operation_name' => 'get']),
242-
HttpKernelInterface::MASTER_REQUEST,
242+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
243243
$response
244244
);
245245

@@ -269,7 +269,7 @@ public function testDummyHeaderTag(): void
269269
$event = new ResponseEvent(
270270
$this->prophesize(HttpKernelInterface::class)->reveal(),
271271
new Request([], [], ['_resources' => ['/foo' => '/foo', '/bar' => '/bar'], '_api_resource_class' => Dummy::class, '_api_operation_name' => 'get']),
272-
HttpKernelInterface::MASTER_REQUEST,
272+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
273273
$response
274274
);
275275

tests/Symfony/EventListener/WriteListenerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testOnKernelViewWithControllerResultAndPersist(): void
8383
$event = new ViewEvent(
8484
$this->prophesize(HttpKernelInterface::class)->reveal(),
8585
$request,
86-
HttpKernelInterface::MASTER_REQUEST,
86+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
8787
$operationResource
8888
);
8989

@@ -118,7 +118,7 @@ public function testOnKernelViewDoNotCallIriConverterWhenOutputClassDisabled():
118118
$event = new ViewEvent(
119119
$this->prophesize(HttpKernelInterface::class)->reveal(),
120120
$request,
121-
HttpKernelInterface::MASTER_REQUEST,
121+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
122122
$operationResource
123123
);
124124

@@ -144,7 +144,7 @@ public function testOnKernelViewWithControllerResultAndRemove(): void
144144
$event = new ViewEvent(
145145
$this->prophesize(HttpKernelInterface::class)->reveal(),
146146
$request,
147-
HttpKernelInterface::MASTER_REQUEST,
147+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
148148
$operationResource
149149
);
150150

@@ -172,7 +172,7 @@ public function testOnKernelViewWithSafeMethod(): void
172172
$event = new ViewEvent(
173173
$this->prophesize(HttpKernelInterface::class)->reveal(),
174174
$request,
175-
HttpKernelInterface::MASTER_REQUEST,
175+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
176176
$operationResource
177177
);
178178

@@ -190,7 +190,7 @@ public function testDoNotWriteWhenControllerResultIsResponse(): void
190190
$event = new ViewEvent(
191191
$this->prophesize(HttpKernelInterface::class)->reveal(),
192192
$request,
193-
HttpKernelInterface::MASTER_REQUEST,
193+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
194194
$response
195195
);
196196

@@ -215,7 +215,7 @@ public function testDoNotWriteWhenCant(): void
215215
$event = new ViewEvent(
216216
$this->prophesize(HttpKernelInterface::class)->reveal(),
217217
$request,
218-
HttpKernelInterface::MASTER_REQUEST,
218+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
219219
$operationResource
220220
);
221221

@@ -237,7 +237,7 @@ public function testOnKernelViewWithNoResourceClass(): void
237237
$event = new ViewEvent(
238238
$this->prophesize(HttpKernelInterface::class)->reveal(),
239239
$request,
240-
HttpKernelInterface::MASTER_REQUEST,
240+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
241241
$operationResource
242242
);
243243

@@ -268,7 +268,7 @@ public function testOnKernelViewInvalidIdentifiers(): void
268268
$event = new ViewEvent(
269269
$this->prophesize(HttpKernelInterface::class)->reveal(),
270270
$request,
271-
HttpKernelInterface::MASTER_REQUEST,
271+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
272272
$attributeResource
273273
);
274274

tests/Symfony/Validator/Metadata/ValidationExceptionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getConstraintViolationList(): ConstraintViolationListInterface
9494
$exceptionEvent = new ExceptionEvent(
9595
$this->prophesize(HttpKernelInterface::class)->reveal(),
9696
new Request(),
97-
HttpKernelInterface::MASTER_REQUEST,
97+
\defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST,
9898
$exception
9999
);
100100

0 commit comments

Comments
 (0)