21 private $objectManager;
27 $this->collection = $this->objectManager->create(
30 $this->collection->setPeriod(
'day')
31 ->setDateRange(
null,
null)
32 ->addStoreFilter([1]);
41 public function testGetItems()
45 $order = $this->objectManager->create(\
Magento\Sales\Model\Order::class);
46 $order->loadByIncrementId(
'100000001');
47 $invoiceCreatedAt =
$order->getInvoiceCollection()
51 $dateTime = $this->objectManager->create(\
Magento\Framework\Stdlib\DateTime\DateTimeFactory::class)
54 $timezone = $this->objectManager->create(\
Magento\Framework\Stdlib\DateTime\TimezoneInterface::class);
55 $invoiceCreatedAt = $timezone->formatDateTime(
57 \IntlDateFormatter::SHORT,
58 \IntlDateFormatter::NONE,
63 $invoiceCreatedAtDate =
$dateTime->date(
'Y-m-d', $invoiceCreatedAt);
68 'orders_invoiced' => 1,
69 'period' => $invoiceCreatedAtDate
74 foreach ($this->collection->getItems() as $reportItem) {
76 'orders_count' => $reportItem->getData(
'orders_count'),
77 'orders_invoiced' => $reportItem->getData(
'orders_invoiced'),
78 'period' => $reportItem->getData(
'period')
81 $this->assertEquals($expectedResult, $actualResult);
static getObjectManager()