Skip to content

Commit

Permalink
Merge pull request #20 from BitBagCommerce/op-334-sylius-1.13-support
Browse files Browse the repository at this point in the history
OP-334: Sylius 1.13 support
  • Loading branch information
GracjanJozefczyk authored Jun 25, 2024
2 parents 2332f60 + ec849b3 commit b093c09
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 210 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
types: [opened, synchronize, reopened]
pull_request: ~
release:
types: [ created ]
schedule:
Expand All @@ -14,16 +13,16 @@ on:

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Node ${{ matrix.node }}"

strategy:
fail-fast: false
matrix:
php: [8.0]
php: [8.1, 8.2, 8.3]
symfony: [^5.4, ^6.0]
sylius: [~1.11.0, ~1.12.0]
sylius: [~1.12.0, ~1.13.0]
node: [^14.17.x]
mysql: [5.7, 8.0]

Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
name: Behat logs
path: etc/build/
if-no-files-found: ignore

- name: Failed build Slack notification
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
Expand Down
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"license": "MIT",
"require": {
"php": "^8.0",
"sylius/sylius": "~1.11.0 || ~1.12.0",
"php-http/message-factory": "^1.1"
"sylius/sylius": "~1.12.0 || ~1.13.0",
"php-http/message-factory": "^1.1",
"league/flysystem-bundle": "^2.4"
},
"require-dev": {
"symfony/webpack-encore-bundle": "^1.15",
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"behat/mink-selenium2-driver": "1.4",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/mink": "^1.8",
Expand Down Expand Up @@ -52,6 +53,10 @@
},
"classmap": ["tests/Application/Kernel.php"]
},
"conflict": {
"symfony/framework-bundle": "6.2.8",
"behat/mink-selenium2-driver": ">=1.7.0"
},
"config": {
"allow-plugins": {
"symfony/flex": true,
Expand Down
17 changes: 16 additions & 1 deletion spec/Action/ConvertPaymentActionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
use Sylius\Bundle\PayumBundle\Provider\PaymentDescriptionProviderInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Core\Model\ProductInterface;

final class ConvertPaymentActionSpec extends ObjectBehavior
{
Expand All @@ -44,11 +46,21 @@ function it_executes(
CustomerInterface $customer,
ArrayCollection $items,
\ArrayIterator $arrayIterator,
PaymentDescriptionProviderInterface $paymentDescriptionProvider
PaymentDescriptionProviderInterface $paymentDescriptionProvider,
OrderItemInterface $orderItem,
ProductInterface $product
): void {
$customer->getEmail()->willReturn('user@example.com');
$customer->getId()->willReturn(1);

$orderItem->getProduct()->willReturn($product);
$orderItem->getQuantity()->willReturn(1);
$orderItem->getUnitPrice()->willReturn(445535);
$arrayIterator->valid()->willReturn(true, false);
$arrayIterator->current()->willReturn($orderItem);
$arrayIterator->next()->shouldBeCalled();
$arrayIterator->rewind()->shouldBeCalled();

$items->getIterator()->willReturn($arrayIterator);

$order->getNumber()->willReturn(000001);
Expand All @@ -73,6 +85,9 @@ function it_executes(
'p24_description' => 'description',
'p24_language' => 'pl_PL',
'p24_email' => 'user@example.com',
'p24_name_1' => null,
'p24_quantity_1' => 1,
'p24_price_1' => 445535
])->shouldBeCalled();

$this->execute($request);
Expand Down
13 changes: 12 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

declare(strict_types=1);

return [
use Sylius\Bundle\CoreBundle\SyliusCoreBundle;

$bundles = [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Expand Down Expand Up @@ -62,4 +64,13 @@
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
];

if ( defined(SyliusCoreBundle::class.'::VERSION_ID') && SyliusCoreBundle::VERSION_ID >= '11300') {
$bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true];
}

return $bundles;
14 changes: 0 additions & 14 deletions tests/Application/config/sylius/1.11/bundles.php

This file was deleted.

This file was deleted.

This file was deleted.

148 changes: 0 additions & 148 deletions tests/Application/config/sylius/1.11/packages/security.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/Application/config/sylius/1.12/bundles.php

This file was deleted.

0 comments on commit b093c09

Please sign in to comment.