-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from SzymonKostrubiec/op-316
OP-316 - Add suport for sylius 1.12 and 1.13
- Loading branch information
Showing
113 changed files
with
558 additions
and
977 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; | ||
use SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff; | ||
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', | ||
]); | ||
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']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
parameters: | ||
level: 8 | ||
reportUnmatchedIgnoredErrors: false | ||
checkMissingIterableValueType: false | ||
checkGenericClassInNonGenericObjectType: false | ||
treatPhpDocTypesAsCertain: false | ||
strictRules: | ||
booleansInConditions: false | ||
paths: | ||
- src | ||
- tests/Behat | ||
|
||
excludes_analyse: | ||
# Makes PHPStan crash | ||
- 'src/DependencyInjection/Configuration.php' | ||
|
||
# Test dependencies | ||
- 'tests/Application/app/**.php' | ||
- 'tests/Application/src/**.php' | ||
|
||
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\./' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?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); | ||
|
||
|
@@ -19,10 +20,10 @@ | |
final class AgreementHistoryCheckerSpec extends ObjectBehavior | ||
{ | ||
function let( | ||
AgreementHistoryResolverInterface $agreementHistoryResolver | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
): void { | ||
$this->beConstructedWith( | ||
$agreementHistoryResolver | ||
$agreementHistoryResolver, | ||
); | ||
} | ||
|
||
|
@@ -34,7 +35,7 @@ function it_is_initializable(): void | |
function it_resolves_agreement_correctly( | ||
AgreementInterface $agreement, | ||
AgreementHistoryInterface $agreementHistory, | ||
AgreementHistoryResolverInterface $agreementHistoryResolver | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
): void { | ||
$agreementHistoryResolver->resolveHistory($agreement)->willReturn($agreementHistory); | ||
$agreementHistory->getState()->willReturn('accepted'); | ||
|
@@ -45,12 +46,11 @@ function it_resolves_agreement_correctly( | |
function it_not_resolves_agreement_when_state_is_other( | ||
AgreementInterface $agreement, | ||
AgreementHistoryInterface $agreementHistory, | ||
AgreementHistoryResolverInterface $agreementHistoryResolver | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
): void { | ||
$agreementHistoryResolver->resolveHistory($agreement)->willReturn($agreementHistory); | ||
$agreementHistory->getState()->willReturn('rejected'); | ||
|
||
$this->isAgreementAccepted($agreement)->shouldReturn(false); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?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); | ||
|
||
|
@@ -21,10 +22,10 @@ | |
final class AgreementHistoryModifierSpec extends ObjectBehavior | ||
{ | ||
function let( | ||
AgreementHistoryResolverInterface $agreementHistoryResolver | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
): void { | ||
$this->beConstructedWith( | ||
$agreementHistoryResolver | ||
$agreementHistoryResolver, | ||
); | ||
} | ||
|
||
|
@@ -38,7 +39,7 @@ function it_returns_agreement_history_from_repository( | |
ShopUserInterface $shopUser, | ||
AgreementInterface $agreement, | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
AgreementHistoryInterface $agreementHistory | ||
AgreementHistoryInterface $agreementHistory, | ||
): void { | ||
$agreementHistoryResolver->resolveHistory($agreement)->willReturn($agreementHistory); | ||
$agreementHistory->getId()->willReturn('1'); | ||
|
@@ -49,7 +50,7 @@ function it_returns_agreement_history_from_repository( | |
'registration_form', | ||
$order, | ||
$shopUser, | ||
$agreement | ||
$agreement, | ||
)->shouldReturn($agreementHistory); | ||
} | ||
|
||
|
@@ -58,7 +59,7 @@ function it_sets_data_when_history_id_is_null( | |
ShopUserInterface $shopUser, | ||
AgreementInterface $agreement, | ||
AgreementHistoryResolverInterface $agreementHistoryResolver, | ||
AgreementHistoryInterface $agreementHistory | ||
AgreementHistoryInterface $agreementHistory, | ||
): void { | ||
$agreementHistoryResolver->resolveHistory($agreement)->willReturn($agreementHistory); | ||
$agreementHistory->getId()->willReturn(null); | ||
|
@@ -72,8 +73,7 @@ function it_sets_data_when_history_id_is_null( | |
'registration_form', | ||
$order, | ||
$shopUser, | ||
$agreement | ||
$agreement, | ||
)->shouldReturn($agreementHistory); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?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); | ||
|
||
|
@@ -23,10 +24,10 @@ | |
final class AgreementSubscriberSpec extends ObjectBehavior | ||
{ | ||
function let( | ||
AgreementHandler $agreementHandler | ||
AgreementHandler $agreementHandler, | ||
): void { | ||
$this->beConstructedWith( | ||
$agreementHandler | ||
$agreementHandler, | ||
); | ||
} | ||
|
||
|
@@ -36,7 +37,7 @@ function it_is_initializable(): void | |
} | ||
|
||
function it_quit_function_when_user_is_null( | ||
AgreementCheckedEvent $agreementCheckedEvent | ||
AgreementCheckedEvent $agreementCheckedEvent, | ||
): void { | ||
$agreementCheckedEvent->getEventDataUserId()->willReturn(null); | ||
|
||
|
@@ -50,7 +51,7 @@ function it_processes_successfully( | |
OrderInterface $order, | ||
ShopUserInterface $shopUser, | ||
Collection $userAgreements, | ||
AgreementHandler $agreementHandler | ||
AgreementHandler $agreementHandler, | ||
): void { | ||
$agreementCheckedEvent->getEvent()->willReturn($formEvent); | ||
$agreementCheckedEvent->getEventDataUserId()->willReturn('1'); | ||
|
@@ -65,7 +66,8 @@ function it_processes_successfully( | |
$userAgreements, | ||
'checkout_form', | ||
$order, | ||
$shopUser) | ||
$shopUser, | ||
) | ||
->shouldBeCalled(); | ||
|
||
$this->processAgreementsFromAnywhere($agreementCheckedEvent); | ||
|
@@ -77,7 +79,7 @@ function it_processes_successfully_when_order_id_is_null( | |
OrderInterface $order, | ||
ShopUserInterface $shopUser, | ||
Collection $userAgreements, | ||
AgreementHandler $agreementHandler | ||
AgreementHandler $agreementHandler, | ||
): void { | ||
$agreementCheckedEvent->getEvent()->willReturn($formEvent); | ||
$agreementCheckedEvent->getEventDataUserId()->willReturn('1'); | ||
|
@@ -92,7 +94,8 @@ function it_processes_successfully_when_order_id_is_null( | |
$userAgreements, | ||
'checkout_form', | ||
null, | ||
$shopUser) | ||
$shopUser, | ||
) | ||
->shouldBeCalled(); | ||
|
||
$this->processAgreementsFromAnywhere($agreementCheckedEvent); | ||
|
@@ -106,7 +109,7 @@ function it_processes_successfully_when_data_is_not_instance_of_order( | |
Collection $userAgreements, | ||
AgreementHandler $agreementHandler, | ||
OrderInterface $order2, | ||
CustomerInterface $customer | ||
CustomerInterface $customer, | ||
): void { | ||
$agreementCheckedEvent->getEvent()->willReturn($formEvent); | ||
$agreementCheckedEvent->getEventDataUserId()->willReturn('1'); | ||
|
@@ -121,7 +124,8 @@ function it_processes_successfully_when_data_is_not_instance_of_order( | |
$userAgreements, | ||
'checkout_form', | ||
null, | ||
$shopUser) | ||
$shopUser, | ||
) | ||
->shouldBeCalled(); | ||
|
||
$this->processAgreementsFromAnywhere($agreementCheckedEvent); | ||
|
Oops, something went wrong.