Conversation
This comment was marked as resolved.
This comment was marked as resolved.
| "symfony/property-access": "8.0.*", | ||
| "symfony/runtime": "8.0.*", | ||
| "symfony/security-bundle": "8.0.*", | ||
| "symfony/serializer": "8.0.4", |
There was a problem hiding this comment.
symfony/serializer v8.0.5 breaks the phpunit tests @see symfony/serializer@35b1aec
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Here are the test results
Runtime: PHP 8.4.14
Configuration: /app/phpunit.xml.dist
NNNNNNNNNNNNNNNNNNNNNNNNNNN.................FF.....FF.......... 63 / 123 ( 51%)
............................................................ 123 / 123 (100%)
Faker seed: 952770
Time: 00:40.389, Memory: 125.00 MB
There were 4 failures:
1) App\Tests\Api\Admin\BookTest::asAdminUserICannotCreateABookWithInvalidData@empty data with data (['', ''], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
'@type' => 'ConstraintViolation',
'hydra:title' => 'An error occurred',
'hydra:description' => 'condition: This value should be of type int|string.',
'violations' => Array &1 [
0 => Array &2 [
'propertyPath' => 'condition',
'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
],
],
].
--- Expected
+++ Actual
@@ @@
'propertyPath' => 'condition',
'message' => 'This value should be of type .',
'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+ 'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
),
),
'detail' => 'condition: This value should be of type .',
'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hydra:description' => 'condition: This value should be of type int|string.',
+ 'hydra:description' => 'condition: This value should be of type .',
'hydra:title' => 'An error occurred',
)
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:282
2) App\Tests\Api\Admin\BookTest::asAdminUserICannotCreateABookWithInvalidData@invalid condition with data (['https://gutendex.com/books/31547.json', 'invalid condition'], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
'@type' => 'ConstraintViolation',
'hydra:title' => 'An error occurred',
'hydra:description' => 'condition: This value should be of type int|string.',
'violations' => Array &1 [
0 => Array &2 [
'propertyPath' => 'condition',
'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
],
],
].
--- Expected
+++ Actual
@@ @@
'propertyPath' => 'condition',
'message' => 'This value should be of type .',
'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+ 'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
),
),
'detail' => 'condition: This value should be of type .',
'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hydra:description' => 'condition: This value should be of type int|string.',
+ 'hydra:description' => 'condition: This value should be of type .',
'hydra:title' => 'An error occurred',
)
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:282
3) App\Tests\Api\Admin\BookTest::asAdminUserICannotUpdateABookWithInvalidData@empty data with data (['', ''], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
'@type' => 'ConstraintViolation',
'hydra:title' => 'An error occurred',
'hydra:description' => 'condition: This value should be of type int|string.',
'violations' => Array &1 [
0 => Array &2 [
'propertyPath' => 'condition',
'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
],
],
].
--- Expected
+++ Actual
@@ @@
'propertyPath' => 'condition',
'message' => 'This value should be of type .',
'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+ 'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
),
),
'detail' => 'condition: This value should be of type .',
'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hydra:description' => 'condition: This value should be of type int|string.',
+ 'hydra:description' => 'condition: This value should be of type .',
'hydra:title' => 'An error occurred',
)
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:493
4) App\Tests\Api\Admin\BookTest::asAdminUserICannotUpdateABookWithInvalidData@invalid condition with data (['https://gutendex.com/books/31547.json', 'invalid condition'], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
'@type' => 'ConstraintViolation',
'hydra:title' => 'An error occurred',
'hydra:description' => 'condition: This value should be of type int|string.',
'violations' => Array &1 [
0 => Array &2 [
'propertyPath' => 'condition',
'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
],
],
].
--- Expected
+++ Actual
@@ @@
'propertyPath' => 'condition',
'message' => 'This value should be of type .',
'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+ 'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
),
),
'detail' => 'condition: This value should be of type .',
'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
- 'hydra:description' => 'condition: This value should be of type int|string.',
+ 'hydra:description' => 'condition: This value should be of type .',
'hydra:title' => 'An error occurred',
)
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:493
FAILURES!
Tests: 123, Assertions: 546, Failures: 4, PHPUnit Notices: 27.
There was a problem hiding this comment.
I agree with these changes:
- 'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+ 'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
The problem is about those changes, which are incomplete:
- 'hydra:description' => 'condition: This value should be of type int|string.',
+ 'hydra:description' => 'condition: This value should be of type .',
So indeed you can set symfony/serializer: <8.0.5, and then you (or I, if you don't have time) can investigate for a fix on Symfony/API Platform (depends where the problem is).
There was a problem hiding this comment.
Shouldn't the symfony.lock be updated too?
E2E tests because of the following error:
PHP Fatal error: Uncaught Error: Class "Runtime\FrankenPhpSymfony\Runtime" not found in /app/vendor/autoload_runtime.php:19\nStack trace:\n#0 /app/public/index.php(7): require_once()\n#1 {main}\n thrown in /app/vendor/autoload_runtime.php on line 19
There was a problem hiding this comment.
Please use short syntax: Book instead of \App\Entity\Book (same for Proxy).
(same comments for other Foundry factories)
There was a problem hiding this comment.
According to https://symfony.com/blog/new-in-symfony-7-4-better-php-configuration, the composer.json file must be updated accordingly:
You should commit it to your repository and optionally add a new entry in the autoload section of composer.json (for example, "classmap": ["config/"]).
| "symfony/property-access": "8.0.*", | ||
| "symfony/runtime": "8.0.*", | ||
| "symfony/security-bundle": "8.0.*", | ||
| "symfony/serializer": "8.0.4", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
No description provided.