Fixed api failing test
This commit is contained in:
parent
6e5e0659b4
commit
691354b3ae
|
|
@ -169,12 +169,6 @@ trait ProductAction
|
||||||
$product = $I->haveSimpleProduct($configs, $productStates);
|
$product = $I->haveSimpleProduct($configs, $productStates);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($product !== null) {
|
|
||||||
Event::dispatch('catalog.product.create.after', $product);
|
|
||||||
|
|
||||||
Event::dispatch('catalog.product.update.after', $product);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $product;
|
return $product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -195,11 +189,17 @@ trait ProductAction
|
||||||
|
|
||||||
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.create.after', $product);
|
||||||
|
|
||||||
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
||||||
|
|
||||||
$I->createInventory($product->id, $configs['productInventory'] ?? []);
|
$I->createInventory($product->id, $configs['productInventory'] ?? []);
|
||||||
|
|
||||||
return $product->refresh();
|
$product = $product->refresh();
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.update.after', $product);
|
||||||
|
|
||||||
|
return $product;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -219,10 +219,14 @@ trait ProductAction
|
||||||
|
|
||||||
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.create.after', $product);
|
||||||
|
|
||||||
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
||||||
|
|
||||||
$I->createInventory($product->id, $configs['productInventory'] ?? []);
|
$I->createInventory($product->id, $configs['productInventory'] ?? []);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.update.after', $product);
|
||||||
|
|
||||||
return $product->refresh();
|
return $product->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -243,10 +247,14 @@ trait ProductAction
|
||||||
|
|
||||||
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.create.after', $product);
|
||||||
|
|
||||||
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
||||||
|
|
||||||
$I->createDownloadableLink($product->id);
|
$I->createDownloadableLink($product->id);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.update.after', $product);
|
||||||
|
|
||||||
return $product->refresh();
|
return $product->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,10 +275,14 @@ trait ProductAction
|
||||||
|
|
||||||
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
$product = $I->createProduct($configs['productAttributes'] ?? [], $productStates);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.create.after', $product);
|
||||||
|
|
||||||
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
$I->createAttributeValues($product, $configs['attributeValues'] ?? []);
|
||||||
|
|
||||||
$I->createBookingEventProduct($product->id);
|
$I->createBookingEventProduct($product->id);
|
||||||
|
|
||||||
|
Event::dispatch('catalog.product.update.after', $product);
|
||||||
|
|
||||||
return $product->refresh();
|
return $product->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue