mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Merge branch '1.13' into 1.14
* 1.13: [API] Apply statistics constraints sequentially to fix 500 error when using an undefined parameter Fix OrderAdjustmentsRecalculationTest
This commit is contained in:
commit
f1f6dbbade
3 changed files with 18 additions and 28 deletions
|
|
@ -90,6 +90,7 @@ final class GetStatisticsAction
|
|||
private function createInputDataConstraints(): array
|
||||
{
|
||||
return [
|
||||
new SymfonyConstraints\Sequentially([
|
||||
new SymfonyConstraints\Collection([
|
||||
'channelCode' => new Constraints\Code(),
|
||||
'startDate' => [
|
||||
|
|
@ -103,6 +104,7 @@ final class GetStatisticsAction
|
|||
],
|
||||
]),
|
||||
new SymfonyConstraints\Expression(expression: 'value["startDate"] < value["endDate"]', message: 'sylius.statistics.end_date.invalid'),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -262,10 +262,6 @@ final class StatisticsTest extends JsonApiTestCase
|
|||
'propertyPath' => '[endDate]',
|
||||
'message' => 'This field is missing.',
|
||||
],
|
||||
[
|
||||
'propertyPath' => '',
|
||||
'message' => 'The start date must be earlier than the end date.',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
@ -288,10 +284,6 @@ final class StatisticsTest extends JsonApiTestCase
|
|||
'propertyPath' => '[endDate]',
|
||||
'message' => 'This field is missing.',
|
||||
],
|
||||
[
|
||||
'propertyPath' => '',
|
||||
'message' => 'The start date must be earlier than the end date.',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -355,10 +347,6 @@ final class StatisticsTest extends JsonApiTestCase
|
|||
'propertyPath' => '[endDate]',
|
||||
'message' => 'This value should not be blank.',
|
||||
],
|
||||
[
|
||||
'propertyPath' => '',
|
||||
'message' => 'The start date must be earlier than the end date.',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -392,10 +380,6 @@ final class StatisticsTest extends JsonApiTestCase
|
|||
'propertyPath' => '[startDate]',
|
||||
'message' => 'The date time is not valid ISO 8601 date time in Y-m-d\TH:i:s format.',
|
||||
],
|
||||
[
|
||||
'propertyPath' => '',
|
||||
'message' => 'The start date must be earlier than the end date.',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ final class OrderAdjustmentsRecalculationTest extends TestCase
|
|||
|
||||
private OrderItemInterface $item;
|
||||
|
||||
private OrderItemUnit $unitNumberOne;
|
||||
|
||||
private OrderItemUnit $unitNumberTwo;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$neutralAdjustment = $this->createAdjustment(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, -150, true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue