-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1.0: Add a note about moving configuration files Reorganize directory structure [Admin] Replace custom invoice_channel filter with entity filter from GridBundle [Admin] Remove unneeded route + grid improvements Fix and make consistent the translation keys Minor clean ups Minor refactor SendInvoiceEmailHandler Minor refactor GenerateInvoicesCommand [CI] Update builds' matrix
- Loading branch information
Showing
144 changed files
with
145 additions
and
274 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
File renamed without changes
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<defaults public="true" /> | ||
|
||
<service id="sylius_invoicing_plugin.ui.menu.admin_menu_listener" class="Sylius\InvoicingPlugin\Ui\Menu\AdminMenuListener"> | ||
<tag name="kernel.event_listener" event="sylius.menu.admin.main" method="__invoke" /> | ||
</service> | ||
</services> | ||
</container> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
namespace spec\Sylius\InvoicingPlugin\CommandHandler; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
use Sylius\Component\Core\Model\CustomerInterface; | ||
use Sylius\Component\Core\Model\OrderInterface; | ||
use Sylius\Component\Core\Repository\OrderRepositoryInterface; | ||
|
@@ -41,16 +42,45 @@ function it_requests_an_email_with_an_invoice_to_be_sent( | |
CustomerInterface $customer, | ||
): void { | ||
$orderRepository->findOneByNumber('0000001')->willReturn($order); | ||
|
||
$invoiceRepository->findOneByOrder($order)->willReturn($invoice); | ||
|
||
$order->getCustomer()->willReturn($customer); | ||
|
||
$customer->getEmail()->willReturn('[email protected]'); | ||
$invoiceRepository->findOneByOrder($order)->willReturn($invoice); | ||
|
||
$emailSender->sendInvoiceEmail($invoice, '[email protected]')->shouldBeCalled(); | ||
|
||
$this->__invoke(new SendInvoiceEmail('0000001', new \DateTime('now'))); | ||
$this(new SendInvoiceEmail('0000001')); | ||
} | ||
|
||
function it_does_not_request_an_email_to_be_sent_if_order_was_not_found( | ||
InvoiceRepositoryInterface $invoiceRepository, | ||
OrderRepositoryInterface $orderRepository, | ||
InvoiceEmailSenderInterface $emailSender, | ||
CustomerInterface $customer, | ||
): void { | ||
$orderRepository->findOneByNumber('0000001')->willReturn(null); | ||
|
||
$invoiceRepository->findOneByOrder(Argument::any())->shouldNotBeCalled(); | ||
$customer->getEmail()->shouldNotBeCalled(); | ||
$emailSender->sendInvoiceEmail(Argument::any(), Argument::any())->shouldNotBeCalled(); | ||
|
||
$this(new SendInvoiceEmail('0000001')); | ||
} | ||
|
||
function it_does_not_request_an_email_to_be_sent_if_customer_was_not_found( | ||
InvoiceRepositoryInterface $invoiceRepository, | ||
OrderRepositoryInterface $orderRepository, | ||
InvoiceEmailSenderInterface $emailSender, | ||
OrderInterface $order, | ||
CustomerInterface $customer, | ||
): void { | ||
$orderRepository->findOneByNumber('0000001')->willReturn($order); | ||
$order->getCustomer()->willReturn(null); | ||
|
||
$invoiceRepository->findOneByOrder($order)->shouldNotBeCalled(); | ||
$customer->getEmail()->shouldNotBeCalled(); | ||
$emailSender->sendInvoiceEmail(Argument::any(), Argument::any())->shouldNotBeCalled(); | ||
|
||
$this(new SendInvoiceEmail('0000001')); | ||
} | ||
|
||
function it_does_not_request_an_email_to_be_sent_if_invoice_was_not_found( | ||
|
@@ -61,11 +91,12 @@ function it_does_not_request_an_email_to_be_sent_if_invoice_was_not_found( | |
CustomerInterface $customer, | ||
): void { | ||
$orderRepository->findOneByNumber('0000001')->willReturn($order); | ||
$order->getCustomer()->willReturn($customer); | ||
$invoiceRepository->findOneByOrder($order)->willReturn(null); | ||
|
||
$order->getCustomer()->shouldNotBeCalled(); | ||
$customer->getEmail()->shouldNotBeCalled(); | ||
$emailSender->sendInvoiceEmail(Argument::any(), Argument::any())->shouldNotBeCalled(); | ||
|
||
$this->__invoke(new SendInvoiceEmail('0000001', new \DateTime('now'))); | ||
$this(new SendInvoiceEmail('0000001')); | ||
} | ||
} |
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
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
Oops, something went wrong.