1
0
mirror of synced 2025-01-19 01:11:42 +03:00
woocommerce-module/tests/order/test-wc-retailcrm-order-item.php
Akolzin Dmitry cc4e8c9c5b update build
2020-02-25 13:45:17 +03:00

39 lines
999 B
PHP

<?php
/**
* PHP version 5.3
*
* @category Integration
* @author RetailCRM <integration@retailcrm.ru>
* @license http://retailcrm.ru Proprietary
* @link http://retailcrm.ru
* @see http://help.retailcrm.ru
*/
class WC_Retailcrm_Order_Item_Test extends WC_Retailcrm_Test_Case_Helper
{
/** @var WC_Order */
protected $order;
public function setUp()
{
parent::setUp();
$this->order = WC_Helper_Order::create_order();
}
public function test_build()
{
$order_item = new WC_Retailcrm_Order_Item($this->getOptions());
/** @var WC_Order_Item_Product $item */
foreach ($this->order->get_items() as $item) {
$data = $order_item->build($item)->get_data();
$this->assertArrayHasKey('productName', $data);
$this->assertArrayHasKey('initialPrice', $data);
$this->assertArrayHasKey('quantity', $data);
$this->assertArrayHasKey('offer', $data);
}
}
}