2020-05-31 00:02:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-06-11 19:21:51 +00:00
|
|
|
namespace Opdavies\Glassboxx\Tests\ValueObject;
|
2020-05-31 00:02:21 +00:00
|
|
|
|
2020-06-11 19:21:51 +00:00
|
|
|
use Opdavies\Glassboxx\Tests\TestCase;
|
2020-05-31 00:02:21 +00:00
|
|
|
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',
|
2020-06-08 18:33:49 +00:00
|
|
|
'GBP'
|
2020-05-31 00:02:21 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertSame('GBP', $order->getCurrencyCode());
|
|
|
|
$this->assertSame($customer, $order->getCustomer());
|
|
|
|
$this->assertSame('123', $order->getOrderNumber());
|
|
|
|
}
|
|
|
|
}
|