-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework_independent_test.php
More file actions
34 lines (25 loc) · 1.04 KB
/
Copy pathframework_independent_test.php
File metadata and controls
34 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* This script processes the dummy delivery order data and
* returns and array of generated invoices.
*/
require_once __DIR__ . '../vendor/autoload.php';
// Create delivery order containers
$factory = new \App\Delivery\Factory\DeliveryOrderContainerFactory(
new \App\Domain\Factory\DeliveryOrderMapperFactory(),
new \App\Delivery\Factory\NotifierCollectionFactory(),
new \App\Domain\Factory\DeliveryOrderStrategyFactory(),
new \App\Delivery\Validate\EnterpriseOrderValidator(
new \App\Delivery\Stub\EnterpriseDeliveryApiStub()
)
);
$collection = $factory->create(json_decode(\App\Tests\DummyJson::$valid, true));
$service = new \App\Domain\Service\ProcessDeliveryOrderService(
new \App\Delivery\Request\DeliveryOrderRequest($collection),
new \App\Delivery\Response\JsonDeliveryOrderResponse(new \App\Domain\Mapper\InvoiceMapper(
new \App\Domain\Factory\InvoiceFactory(),
new \App\Domain\Factory\DeliveryOrderMapperFactory()
))
);
$response = $service->process();
print($response->getJson());