-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
536b8cd
commit f62205c
Showing
78 changed files
with
421 additions
and
295 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
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); | ||
|
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,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); | ||
|
@@ -31,7 +32,7 @@ function let( | |
DataCollectorTranslator $dataCollectorTranslator, | ||
RouterInterface $router, | ||
Request $request, | ||
ParameterBagInterface $attributes | ||
ParameterBagInterface $attributes, | ||
): void { | ||
$request->attributes = $attributes; | ||
|
||
|
@@ -47,7 +48,7 @@ function it_should_do_nothing_when_route_is_not_create_email_template( | |
RequestEvent $requestEvent, | ||
Request $request, | ||
ParameterBag $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider | ||
EmailCodesProviderInterface $emailCodesProvider, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
|
||
|
@@ -64,7 +65,7 @@ function it_should_not_redirect_when_type_are_available_to_create_email_template | |
ParameterBag $attributes, | ||
EmailCodesProviderInterface $emailCodesProvider, | ||
Session $session, | ||
FlashBagInterface $flashBag | ||
FlashBagInterface $flashBag, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
|
||
|
@@ -90,7 +91,7 @@ function it_should_redirect_when_route_is_create_email_template( | |
Session $session, | ||
FlashBagInterface $flashBag, | ||
RouterInterface $router, | ||
DataCollectorTranslator $dataCollectorTranslator | ||
DataCollectorTranslator $dataCollectorTranslator, | ||
): void { | ||
$requestEvent->getRequest()->willReturn($request); | ||
|
||
|
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,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); | ||
|
@@ -37,13 +38,13 @@ function it_is_initializable(): void | |
function it_should_do_nothing_if_exception_is_not_a_twig_security_error( | ||
HttpKernelInterface $httpKernel, | ||
Request $request, | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider, | ||
): void { | ||
$exceptionEvent = new ExceptionEvent( | ||
$httpKernel->getWrappedObject(), | ||
$request->getWrappedObject(), | ||
HttpKernelInterface::MASTER_REQUEST, | ||
new \Exception() | ||
new \Exception(), | ||
); | ||
$customTwigErrorResponseProvider->provide(Argument::type(Error::class))->shouldNotBeCalled(); | ||
|
||
|
@@ -53,14 +54,14 @@ function it_should_do_nothing_if_exception_is_not_a_twig_security_error( | |
function it_should_do_nothing_if_provided_custom_response_is_null( | ||
HttpKernelInterface $httpKernel, | ||
Request $request, | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider, | ||
): void { | ||
$genericResponse = new Response(); | ||
$exceptionEvent = new ExceptionEvent( | ||
$httpKernel->getWrappedObject(), | ||
$request->getWrappedObject(), | ||
HttpKernelInterface::MASTER_REQUEST, | ||
new \Exception() | ||
new \Exception(), | ||
); | ||
$exceptionEvent->setResponse($genericResponse); | ||
$customTwigErrorResponseProvider->provide(Argument::type(Error::class))->willReturn(null); | ||
|
@@ -73,15 +74,15 @@ function it_should_do_nothing_if_provided_custom_response_is_null( | |
function it_should_set_response_to_the_provided_custom_twig_error_response( | ||
HttpKernelInterface $httpKernel, | ||
Request $request, | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider | ||
CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider, | ||
): void { | ||
$jsonResponse = new JsonResponse(); | ||
$error = new Error('foo'); | ||
$exceptionEvent = new ExceptionEvent( | ||
$httpKernel->getWrappedObject(), | ||
$request->getWrappedObject(), | ||
HttpKernelInterface::MASTER_REQUEST, | ||
$error | ||
$error, | ||
); | ||
$exceptionEvent->setResponse(new Response()); | ||
$customTwigErrorResponseProvider->provide($error)->willReturn($jsonResponse); | ||
|
7 changes: 4 additions & 3 deletions
7
spec/MailPreviewData/Factory/CustomerPreviewDataFactorySpec.php
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,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); | ||
|
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
@@ -47,7 +54,7 @@ function it_should_throw_exception_if_passed_object_not_implementing_the_proper_ | |
function it_should_return_first_supporting_custom_twig_error_response( | ||
TwigErrorResponseInterface $firstResponse, | ||
TwigErrorResponseInterface $secondResponse, | ||
TwigErrorResponseInterface $thirdResponse | ||
TwigErrorResponseInterface $thirdResponse, | ||
): void { | ||
$error = new Error('foo'); | ||
$firstJsonResponse = new JsonResponse(); | ||
|
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
@@ -34,12 +41,12 @@ class EmailCodesProviderSpec extends ObjectBehavior | |
|
||
function let( | ||
EmailTemplateRepositoryInterface $emailTemplateRepository, | ||
DataCollectorTranslator $dataCollectorTranslator | ||
DataCollectorTranslator $dataCollectorTranslator, | ||
): void { | ||
$this->beConstructedWith( | ||
self::EXAMPLE_EMAILS_CONFIGURATION, | ||
$emailTemplateRepository, | ||
$dataCollectorTranslator | ||
$dataCollectorTranslator, | ||
); | ||
} | ||
|
||
|
@@ -93,12 +100,12 @@ function it_should_return_not_email_template_types(EmailTemplateRepositoryInterf | |
function it_should_return_not_used_types_for_edit_email_template( | ||
EmailTemplateRepositoryInterface $emailTemplateRepository, | ||
EmailTemplateInterface $emailTemplate, | ||
DataCollectorTranslator $dataCollectorTranslator | ||
DataCollectorTranslator $dataCollectorTranslator, | ||
): void { | ||
$dataCollectorTranslator->trans( | ||
'Contact Request', | ||
[], | ||
EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN | ||
EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN, | ||
)->shouldBeCalled()->willReturn('Contact Request'); | ||
|
||
$emailTemplateRepository->getAllTypes()->willReturn([ | ||
|
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
@@ -35,7 +42,7 @@ function it_should_throw_exception_if_generic_mail_preview_data_doesnt_exist(): | |
} | ||
|
||
function it_should_return_generic_mail_preview_data_if_none_mail_preview_data_for_requested_type_exist( | ||
MailPreviewDataInterface $genericMailPreviewData | ||
MailPreviewDataInterface $genericMailPreviewData, | ||
): void { | ||
$availableMailPreviewData = [ | ||
MailPreviewDataProvider::GENERIC_PREVIEW_DATA_KEY => $genericMailPreviewData, | ||
|
@@ -60,7 +67,7 @@ function it_should_throw_exception_if_matched_mail_preview_data_is_not_implement | |
|
||
function it_should_return_mail_preview_data_for_requested_type( | ||
MailPreviewDataInterface $genericMailPreviewData, | ||
MailPreviewDataInterface $fooMailPreviewData | ||
MailPreviewDataInterface $fooMailPreviewData, | ||
): void { | ||
$availableMailPreviewData = [ | ||
MailPreviewDataProvider::GENERIC_PREVIEW_DATA_KEY => $genericMailPreviewData, | ||
|
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,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); | ||
|
@@ -111,7 +112,7 @@ function it_invokes_decorated_class_method_on_remove(RepositoryInterface $reposi | |
function it_finds_one_by_locale_code_and_type( | ||
EntityRepository $repository, | ||
QueryBuilder $queryBuilder, | ||
AbstractQuery $query | ||
AbstractQuery $query, | ||
): void { | ||
$repository->createQueryBuilder('tt', null)->willReturn($queryBuilder); | ||
|
||
|
7 changes: 7 additions & 0 deletions
7
spec/Response/TwigError/SecurityNotAllowedFilterErrorResponseSpec.php
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
7 changes: 7 additions & 0 deletions
7
spec/Response/TwigError/SecurityNotAllowedFunctionErrorResponseSpec.php
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
7 changes: 7 additions & 0 deletions
7
spec/Response/TwigError/SecurityNotAllowedMethodErrorResponseSpec.php
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
7 changes: 7 additions & 0 deletions
7
spec/Response/TwigError/SecurityNotAllowedPropertyErrorResponseSpec.php
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
7 changes: 7 additions & 0 deletions
7
spec/Response/TwigError/SecurityNotAllowedTagErrorResponseSpec.php
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,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* 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); | ||
|
||
/* | ||
|
Oops, something went wrong.