Merge pull request #2444 from Haendlerbund/add-data-to-factories
Added fields to order related factories
This commit is contained in:
commit
3fb2b8a5c9
|
|
@ -49,6 +49,8 @@ $factory->define(Order::class, function (Faker $faker) {
|
|||
'channel_id' => 1,
|
||||
'channel_type' => Channel::class,
|
||||
'cart_id' => 0,
|
||||
'shipping_method' => 'free_free',
|
||||
'shipping_title' => 'Free Shipping',
|
||||
];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ $factory->define(OrderItem::class, function (Faker $faker) {
|
|||
},
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
'product_type' => Product::class,
|
||||
];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ use Faker\Generator as Faker;
|
|||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Sales\Models\OrderPayment;
|
||||
|
||||
$factory->define(OrderPayment::class, function (Faker $faker) {
|
||||
$now = date("Y-m-d H:i:s");
|
||||
$factory->define(OrderPayment::class, function (Faker $faker, array $attributes) {
|
||||
|
||||
if (!array_key_exists('order_id', $attributes)) {
|
||||
throw new InvalidArgumentException('order_id must be provided.');
|
||||
}
|
||||
|
||||
return [
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
'method' => 'cashondelivery',
|
||||
];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class GuestCheckoutCest
|
|||
$this->faker = Factory::create();
|
||||
|
||||
$pConfigDefault = [
|
||||
'productInventory' => ['qty' => $this->faker->randomNumber(2)],
|
||||
'productInventory' => ['qty' => $this->faker->numberBetween(1, 1000)],
|
||||
'attributeValues' => [
|
||||
'status' => true,
|
||||
'new' => 1,
|
||||
|
|
@ -27,7 +27,7 @@ class GuestCheckoutCest
|
|||
],
|
||||
];
|
||||
$pConfigGuestCheckout = [
|
||||
'productInventory' => ['qty' => $this->faker->randomNumber(2)],
|
||||
'productInventory' => ['qty' => $this->faker->numberBetween(1, 1000)],
|
||||
'attributeValues' => [
|
||||
'status' => true,
|
||||
'new' => 1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue