Skip to content

Commit 1fe8968

Browse files
committed
chore: fixes lowest and symfony dev tests
1 parent dfe4fd7 commit 1fe8968

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

src/JsonSchema/Tests/Metadata/Property/Factory/SchemaPropertyMetadataFactoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ public function testWithCustomOpenApiContextWithoutTypeDefinition(): void
146146

147147
public function testUnionTypeAnyOfIsArray(): void
148148
{
149+
if (!method_exists(PropertyInfoExtractor::class, 'getType')) { // @phpstan-ignore-line symfony/property-info 6.4 is still allowed and this may be true
150+
$this->markTestSkipped('This test only supports type-info component');
151+
}
152+
149153
$resourceClassResolver = $this->createMock(ResourceClassResolverInterface::class);
150154
$apiProperty = new ApiProperty(nativeType: Type::union(Type::string(), Type::int()));
151155
$decorated = $this->createMock(PropertyMetadataFactoryInterface::class);

src/JsonSchema/Tests/SchemaFactoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public function testBuildSchemaForNonResourceClassLegacy(): void
124124

125125
public function testBuildSchemaForNonResourceClass(): void
126126
{
127+
if (!method_exists(PropertyInfoExtractor::class, 'getType')) { // @phpstan-ignore-line symfony/property-info 6.4 is still allowed and this may be true
128+
$this->markTestSkipped('This test only supports type-info component');
129+
}
130+
127131
$resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataCollectionFactoryInterface::class);
128132

129133
$propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class);

src/JsonSchema/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"require": {
2727
"php": ">=8.2",
28-
"api-platform/metadata": "^4.2@beta",
28+
"api-platform/metadata": "^4.2",
2929
"symfony/console": "^6.4 || ^7.0",
3030
"symfony/property-info": "^6.4 || ^7.1",
3131
"symfony/serializer": "^6.4 || ^7.0",

src/Symfony/Validator/State/ParameterValidatorProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
8787
$violation->getInvalidValue(),
8888
$violation->getPlural(),
8989
$violation->getCode(),
90-
$violation->getConstraint(),
91-
$violation->getCause()
90+
// TODO: remove these with symfony ^7
91+
method_exists($violation, 'getConstraint') ? $violation->getConstraint() : null, // @phpstan-ignore-line symfony/validator 6.4 is still allowed and this may be true
92+
method_exists($violation, 'getCause') ? $violation->getCause() : null // @phpstan-ignore-line symfony/validator 6.4 is still allowed and this may be true
9293
));
9394
}
9495
}

tests/Fixtures/app/AppKernel.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use Symfony\Component\Config\Loader\LoaderInterface;
3838
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
3939
use Symfony\Component\DependencyInjection\ContainerBuilder;
40-
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
4140
use Symfony\Component\HttpClient\Messenger\PingWebhookMessageHandler;
4241
use Symfony\Component\HttpFoundation\Session\SessionFactory;
4342
use Symfony\Component\HttpKernel\Kernel;
@@ -238,9 +237,6 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
238237
}
239238

240239
$twigConfig = ['strict_variables' => '%kernel.debug%'];
241-
if (interface_exists(ErrorRendererInterface::class)) {
242-
$twigConfig['exception_controller'] = null;
243-
}
244240
$c->prependExtensionConfig('twig', $twigConfig);
245241

246242
$useSymfonyListeners = (bool) ($_SERVER['USE_SYMFONY_LISTENERS'] ?? false);

0 commit comments

Comments
 (0)