mirror of
https://github.com/opdavies/glassboxx-sdk-php.git
synced 2025-02-15 14:00:47 +00:00
This allows for the sending of multiple items in a single order, by adding a new `OrderItem` class and moving all of the order item specific fields from the `Order` to an individual item. These can then be assigned to an order using the `withOrderItems()` method as an array of order items. Fixes #19
31 lines
799 B
PHP
31 lines
799 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Opdavies\Glassboxx\Tests\Glassboxx\ValueObject;
|
|
|
|
use Opdavies\Glassboxx\Tests\Glassboxx\TestCase;
|
|
use Opdavies\Glassboxx\ValueObject\Customer;
|
|
use Opdavies\Glassboxx\ValueObject\CustomerInterface;
|
|
use Opdavies\Glassboxx\ValueObject\Order;
|
|
|
|
class OrderTest extends TestCase
|
|
{
|
|
public function testCreatingAnOrder(): void
|
|
{
|
|
$customer = $this->getMockBuilder(CustomerInterface::class)
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$order = new Order(
|
|
$customer,
|
|
'123',
|
|
'GBP'
|
|
);
|
|
|
|
$this->assertSame('GBP', $order->getCurrencyCode());
|
|
$this->assertSame($customer, $order->getCustomer());
|
|
$this->assertSame('123', $order->getOrderNumber());
|
|
}
|
|
}
|