Eccube\Tests\Web\Admin\Order\EditControllerWithMultipleTest::createShipping PHP Method

createShipping() public method

引数に渡した商品規格のお届け商品明細が生成される.
public createShipping ( array $ProductClasses ) : array
$ProductClasses array 商品規格の配列.
return array
    public function createShipping(array $ProductClasses)
    {
        $faker = $this->getFaker();
        $tel = explode('-', $faker->phoneNumber);
        $delivery_date = $faker->dateTimeBetween('now', '+ 5 days');
        $ShippingItems = array();
        foreach ($ProductClasses as $ProductClass) {
            $ShippingItems[] = array('Product' => $ProductClass->getProduct()->getId(), 'ProductClass' => $ProductClass->getId(), 'price' => $ProductClass->getPrice02(), 'quantity' => $faker->randomNumber(2), 'itemidx' => '');
        }
        $Shipping = array('ShipmentItems' => $ShippingItems, 'name' => array('name01' => $faker->lastName, 'name02' => $faker->firstName), 'kana' => array('kana01' => $faker->lastKanaName, 'kana02' => $faker->firstKanaName), 'company_name' => $faker->company, 'zip' => array('zip01' => $faker->postcode1(), 'zip02' => $faker->postcode2()), 'address' => array('pref' => $faker->numberBetween(1, 47), 'addr01' => $faker->city, 'addr02' => $faker->streetAddress), 'tel' => array('tel01' => $tel[0], 'tel02' => $tel[1], 'tel03' => $tel[2]), 'fax' => array('fax01' => $tel[0], 'fax02' => $tel[1], 'fax03' => $tel[2]), 'Delivery' => '1', 'DeliveryTime' => '1', 'shipping_delivery_date' => array('year' => $delivery_date->format('Y'), 'month' => $delivery_date->format('n'), 'day' => $delivery_date->format('j')));
        return $Shipping;
    }