Skip to content

Commit 178939b

Browse files
committed
MC-33069: Stabilize Unit tests
1 parent d7a69b9 commit 178939b

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

setup/src/Magento/Setup/Fixtures/Quote/QuoteGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ private function prepareConfigurableProducts(array $productIds = [])
689689
foreach ($options as $option) {
690690
$attributesInfo[] = [
691691
"label" => $option->getLabel(),
692-
"value" => $option['options']['0']['label'],
692+
"value" => isset($option['options']) ? $option['options']['0']['label'] : null,
693693
"option_id" => $option->getAttributeId(),
694694
"option_value" => $option->getValues()[0]->getValueIndex()
695695
];

setup/src/Magento/Setup/Test/Unit/Fixtures/CartPriceRulesFixtureTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function testGenerateAdvancedCondition($ruleId, $categoriesArray, $ruleCo
173173
'type' => Product::class,
174174
'attribute' => 'category_ids',
175175
'operator' => '==',
176-
'value' => null,
176+
'value' => 0,
177177
];
178178

179179
$secondCondition = [
@@ -261,8 +261,8 @@ public function testGenerateAdvancedCondition($ruleId, $categoriesArray, $ruleCo
261261
public function dataProviderGenerateAdvancedCondition()
262262
{
263263
return [
264-
[1, [0], 1],
265-
[1, [0], 300]
264+
[1, [[0]], 1],
265+
[1, [[0]], 300]
266266
];
267267
}
268268

setup/src/Magento/Setup/Test/Unit/Fixtures/IndexersStatesApplyFixtureTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ public function testExecute()
6060
->expects($this->once())
6161
->method('getValue')
6262
->willReturn([
63-
'indexer' => ['id' => 1]
63+
'indexer' => [
64+
[
65+
'id' => 1,
66+
'set_scheduled' => false,
67+
]
68+
]
6469
]);
6570
$this->fixtureModelMock
6671
->method('getObjectManager')

setup/src/Magento/Setup/Test/Unit/Fixtures/Quote/QuoteGeneratorTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,6 @@ private function prepareProducts()
234234
->disableOriginalConstructor()
235235
->getMockForAbstractClass();
236236
$option = $this->getMockBuilder(Attribute::class)
237-
->setConstructorArgs(
238-
[
239-
'data' => [
240-
'options' => [
241-
['label' => null],
242-
],
243-
],
244-
],
245-
)
246237
->disableOriginalConstructor()
247238
->getMock();
248239
$optionValue = $this->getMockBuilder(OptionValueInterface::class)

0 commit comments

Comments
 (0)