-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OP-267/Sylius 1.12 and 1.13 support #27
Changes from 27 commits
877a733
e7676a8
272b54a
44f7c03
245b001
274cba2
4c3092f
c294c2f
18c9900
64608ce
3a30353
536b8cd
f62205c
d1a939b
946ccaf
cfe2559
c5855d0
db5761b
ec11a89
728da89
77033c7
d8e146d
288b352
cccbdfc
7e3aaa9
8561a72
2e5f594
5aebc60
b12ee94
aee3fb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,21 +21,17 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ["8.0", "7.4"] | ||
symfony: ["^4.4", "^5.2"] | ||
sylius: ["~1.9.6", "~1.10.0", "~1.11.0"] | ||
php: ["8.2"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 8.1 and 8.2? |
||
symfony: ["^5.4", "^6.0"] | ||
sylius: ["~1.12.0", "~1.13.0"] | ||
node: ["14.x"] | ||
mysql: ["8.0"] | ||
state_machine_adapter: ["winzou_state_machine", "symfony_workflow"] | ||
|
||
exclude: | ||
- sylius: ~1.9.6 | ||
php: 8.0 | ||
|
||
- sylius: ~1.10.0 | ||
symfony: 4.4 | ||
|
||
- sylius: ~1.11.0 | ||
php: 7.4 | ||
- | ||
sylius: ~1.12.0 | ||
state_machine_adapter: "symfony_workflow" | ||
|
||
env: | ||
APP_ENV: test | ||
|
@@ -81,15 +77,15 @@ jobs: | |
name: Install PHP dependencies | ||
run: composer install --no-interaction | ||
|
||
- | ||
- | ||
name: Run ECS | ||
run: vendor/bin/ecs | ||
|
||
- | ||
name: Run PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src/ | ||
- | ||
run: vendor/bin/phpstan analyse -c phpstan.neon | ||
|
||
- | ||
name: Failed build Slack notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,15 @@ | |
], | ||
"license": "MIT", | ||
"require": { | ||
"php": "^7.4 || ^8.0", | ||
"sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0", | ||
"twig/inky-extra": "^3.3" | ||
"php": "^8.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^8.1? |
||
"sylius/sylius": "~1.12.0 || ~1.13.0", | ||
"twig/inky-extra": "^3.3", | ||
"doctrine/annotations": "^1.14" | ||
}, | ||
"require-dev": { | ||
"behat/behat": "^3.6.1", | ||
"behat/mink-selenium2-driver": "^1.4", | ||
"bitbag/coding-standard": "^1.0", | ||
"behat/behat": "^3.7", | ||
"behat/mink-selenium2-driver": "~1.6.0", | ||
"bitbag/coding-standard": "^3.0.0", | ||
"dmore/behat-chrome-extension": "^1.3", | ||
"dmore/chrome-mink-driver": "^2.7", | ||
"friends-of-behat/mink": "^1.8", | ||
|
@@ -27,30 +28,18 @@ | |
"friends-of-behat/suite-settings-extension": "^1.0", | ||
"friends-of-behat/symfony-extension": "^2.1", | ||
"friends-of-behat/variadic-extension": "^1.3", | ||
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev", | ||
"lchrusciel/api-test-case": "^5.2", | ||
"phpspec/phpspec": "^7.0", | ||
"phpstan/extension-installer": "^1.0", | ||
"phpstan/phpstan": "0.12.85", | ||
"phpstan/phpstan-doctrine": "0.12.33", | ||
"phpstan/phpstan-strict-rules": "^0.12.0", | ||
"phpstan/phpstan-webmozart-assert": "0.12.12", | ||
"phpunit/phpunit": "^9.5", | ||
"sensiolabs/security-checker": "^6.0", | ||
"sylius-labs/coding-standard": "^4.0", | ||
"symfony/browser-kit": "^4.4 || ^5.2", | ||
"symfony/debug-bundle": "^4.4 || ^5.2", | ||
"symfony/dotenv": "^4.4 || ^5.2", | ||
"symfony/intl": "^4.4 || ^5.2", | ||
"symfony/web-profiler-bundle": "^4.4 || ^5.2", | ||
"symfony/browser-kit": "^5.4 || ^6.0", | ||
"symfony/debug-bundle": "^5.4 || ^6.0", | ||
"symfony/dotenv": "^5.4 || ^6.0", | ||
"symfony/intl": "^5.4 || ^6.0", | ||
"symfony/web-profiler-bundle": "^5.4 || ^6.0", | ||
"symfony/webpack-encore-bundle": "^1.13", | ||
"vimeo/psalm": "4.7.1", | ||
"polishsymfonycommunity/symfony-mocker-container": "^1.0" | ||
}, | ||
"conflict": { | ||
"doctrine/dbal": "^3.0", | ||
"doctrine/orm": ">=2.15.2" | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.4' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would write in README.md or similar, how to test the e-mails There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the |
||
|
||
services: | ||
mailhog: | ||
# do not use in production! | ||
image: mailhog/mailhog:latest | ||
environment: | ||
- MH_STORAGE=maildir | ||
# volumes: | ||
# - ./docker/mailhog/maildir:/maildir:rw,delegated | ||
ports: | ||
- "8025:8025" | ||
- "1025:1025" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
use Symplify\EasyCodingStandard\ValueObject\Option; | ||
declare(strict_types=1); | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php'); | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
__DIR__ . '/spec', | ||
]); | ||
$parameters->set(Option::SKIP, [ | ||
__DIR__ . '/tests/Application', | ||
VisibilityRequiredFixer::class => ['*Spec.php'], | ||
]); | ||
return static function (ECSConfig $config): void { | ||
|
||
putenv('ALLOW_BITBAG_OS_HEADER=1'); | ||
|
||
$config->import('vendor/bitbag/coding-standard/ecs.php'); | ||
$config->paths(['src', 'spec', 'tests/Repository', 'tests/Behat']); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ Feature: Receiving confirmation email after finalizing checkout | |
|
||
@ui @email | ||
Scenario: Receiving a custom confirmation email after finalizing checkout | ||
Given there is mail template with "order_confirmation" type and "Order confirmation" name and "Congratulations, you have bought new gun" subject and "Pif paf </br> {{order.number}}" content | ||
Given there is mail template with "order_confirmation" type and "Order confirmation" name and "Congratulations, you have bought new gun" subject and "Pif paf {{order.number}}" content | ||
And I have product "Sig Sauer P226" in the cart | ||
And I have completed addressing step with email "[email protected]" and "United States" based billing address | ||
And I have proceeded order with "Free" shipping method and "Offline" payment | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ Feature: Receiving set of welcoming emails after registration | |
|
||
@ui @email | ||
Scenario: Receiving a custom welcoming email after registration | ||
Given there is mail template with "user_registration" type and "User registration" name and "Welcome to our shop!" subject and "Enjoy our stuff!" content | ||
Given there is mail template with "verification_token" type and "User registration" name and "Welcome to our shop!" subject and "Enjoy our stuff!" content | ||
When I register with email "[email protected]" and password "suitsarelife" | ||
Then a welcoming email should have been sent to "[email protected]" | ||
|
||
|
@@ -24,7 +24,7 @@ Feature: Receiving set of welcoming emails after registration | |
When I register with email "[email protected]" and password "suitsarelife" | ||
Then I should be notified that my account has been created and the verification email has been sent | ||
And a default account verification email should have been sent to "[email protected]" | ||
And 2 emails should be sent to "[email protected]" | ||
And emails should be sent to "[email protected]" depending on Sylius version | ||
But I should not be able to log in as "[email protected]" with "suitsarelife" password | ||
|
||
@ui @email | ||
|
@@ -33,5 +33,5 @@ Feature: Receiving set of welcoming emails after registration | |
When I register with email "[email protected]" and password "suitsarelife" | ||
Then I should be notified that my account has been created and the verification email has been sent | ||
And a custom account verification email should have been sent to "[email protected]" | ||
And 2 emails should be sent to "[email protected]" | ||
And emails should be sent to "[email protected]" depending on Sylius version | ||
But I should not be able to log in as "[email protected]" with "suitsarelife" password |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
includes: | ||
- vendor/bitbag/coding-standard/phpstan.neon | ||
parameters: | ||
level: 8 | ||
reportUnmatchedIgnoredErrors: false | ||
checkMissingIterableValueType: false | ||
checkGenericClassInNonGenericObjectType: false | ||
|
||
excludes_analyse: | ||
# Makes PHPStan crash | ||
- 'src/DependencyInjection/Configuration.php' | ||
|
||
# Test dependencies | ||
- 'tests/Application/*' | ||
|
||
# ECS Fixer dependency | ||
- 'src/Fixer' | ||
ignoreErrors: | ||
- '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./' | ||
excludePaths: | ||
- tests/Repository | ||
paths: | ||
- src | ||
- tests |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
@@ -41,14 +42,14 @@ function it_is_initializable( | |
SenderAdapterInterface $senderAdapter, | ||
EmailProviderInterface $provider, | ||
DefaultSettingsProviderInterface $defaultSettingsProvider, | ||
EmailTemplateTranslationRepositoryInterface $templateTranslationRepository | ||
EmailTemplateTranslationRepositoryInterface $templateTranslationRepository, | ||
): void { | ||
$this->beConstructedWith( | ||
$rendererAdapter, | ||
$senderAdapter, | ||
$provider, | ||
$defaultSettingsProvider, | ||
$templateTranslationRepository | ||
$templateTranslationRepository, | ||
); | ||
$this->shouldHaveType(Sender::class); | ||
} | ||
|
@@ -60,7 +61,7 @@ function it_should_send_email( | |
DefaultSettingsProviderInterface $defaultSettingsProvider, | ||
EmailTemplateTranslationRepositoryInterface $templateTranslationRepository, | ||
EmailInterface $email, | ||
RenderedEmail $renderedEmail | ||
RenderedEmail $renderedEmail, | ||
): void { | ||
$this->beConstructedWith( | ||
$rendererAdapter, | ||
|
@@ -102,7 +103,7 @@ function it_should_set_custom_email_template_if_found( | |
DefaultSettingsProviderInterface $defaultSettingsProvider, | ||
EmailTemplateTranslationRepositoryInterface $templateTranslationRepository, | ||
EmailInterface $email, | ||
RenderedEmail $renderedEmail | ||
RenderedEmail $renderedEmail, | ||
): void { | ||
$this->beConstructedWith( | ||
$rendererAdapter, | ||
|
@@ -122,7 +123,7 @@ function it_should_set_custom_email_template_if_found( | |
$emailTemplateTranslation = new EmailTemplateTranslation(); | ||
$templateTranslationRepository->findOneByLocaleCodeAndType( | ||
self::LOCALE, | ||
self::EMAIL_TYPE | ||
self::EMAIL_TYPE, | ||
)->willReturn($emailTemplateTranslation); | ||
|
||
$rendererAdapter->render($email, Argument::type('array'))->willReturn($renderedEmail); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
@@ -15,7 +16,6 @@ | |
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||
use Symfony\Component\HttpFoundation\ParameterBag; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | ||
|
@@ -31,7 +31,7 @@ function let( | |
DataCollectorTranslator $dataCollectorTranslator, | ||
RouterInterface $router, | ||
Request $request, | ||
ParameterBagInterface $attributes | ||
ParameterBagInterface $attributes, | ||
): void { | ||
$request->attributes = $attributes; | ||
|
||
|
@@ -46,10 +46,12 @@ function it_is_initializable(): void | |
function it_should_do_nothing_when_route_is_not_create_email_template( | ||
RequestEvent $requestEvent, | ||
Request $request, | ||
ParameterBag $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider | ||
ParameterBagInterface $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider, | ||
Session $session, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
$request->getSession()->willReturn($session); | ||
|
||
$attributes->get('_route')->shouldBeCalled()->willReturn('wrong_route'); | ||
|
||
|
@@ -61,10 +63,10 @@ function it_should_do_nothing_when_route_is_not_create_email_template( | |
function it_should_not_redirect_when_type_are_available_to_create_email_template( | ||
RequestEvent $requestEvent, | ||
Request $request, | ||
ParameterBag $attributes, | ||
ParameterBagInterface $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider, | ||
Session $session, | ||
FlashBagInterface $flashBag | ||
FlashBagInterface $flashBag, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
|
||
|
@@ -85,12 +87,12 @@ function it_should_not_redirect_when_type_are_available_to_create_email_template | |
function it_should_redirect_when_route_is_create_email_template( | ||
RequestEvent $requestEvent, | ||
Request $request, | ||
ParameterBag $attributes, | ||
ParameterBagInterface $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider, | ||
Session $session, | ||
FlashBagInterface $flashBag, | ||
RouterInterface $router, | ||
DataCollectorTranslator $dataCollectorTranslator | ||
DataCollectorTranslator $dataCollectorTranslator, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 8.1 and 8.2?