Skip to content

Commit

Permalink
MSI-633: Investigate possible exception with $this->getProductIdsBySk…
Browse files Browse the repository at this point in the history
…us->execute([$sku])[$sku]
  • Loading branch information
RomaKis committed Mar 28, 2018
1 parent 8b474ff commit 39ff5d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
$sourceItemsSave = Bootstrap::getObjectManager()->get(SourceItemsSaveInterface::class);

$sourcesItemsData = [
[
SourceItemInterface::SOURCE_CODE => 'us-1',
SourceItemInterface::SKU => 'configurable',
SourceItemInterface::QUANTITY => 100,
SourceItemInterface::STATUS => SourceItemInterface::STATUS_IN_STOCK,
],
[
SourceItemInterface::SOURCE_CODE => 'us-1',
SourceItemInterface::SKU => 'simple_10',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

$searchCriteria = $searchCriteriaBuilder->addFilter(
SourceItemInterface::SKU,
['configurable_out_of_stock', 'configurable', 'simple_10', 'simple_20', 'simple_30', 'simple_40'],
['simple_10', 'simple_20'],
'in'
)->create();
$sourceItems = $sourceItemRepository->getList($searchCriteria)->getItems();

/**
* Tests which are wrapped with MySQL transaction clear all data by transaction rollback.
* In that case there is "if" which checks that SKU1, SKU2 and SKU3 still exists in database.
* In that case there is "if" which checks that simple_10 and simple_20 still exists in database.
*/
if (!empty($sourceItems)) {
$sourceItemsDelete->execute($sourceItems);
Expand Down

0 comments on commit 39ff5d7

Please sign in to comment.