Skip to content

Commit f406a2e

Browse files
committed
MAGETWO-87776: Build stabilization
1 parent 0876028 commit f406a2e

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Source/InputtypeTest.php

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,37 @@ protected function setUp()
2727
$this->inputtypeModel = $this->objectManagerHelper->getObject(
2828
\Magento\Catalog\Model\Product\Attribute\Source\Inputtype::class,
2929
[
30-
'coreRegistry' => $this->registry
30+
'coreRegistry' => $this->registry,
31+
'optionsArray' => $this->getInputTypeSet()
3132
]
3233
);
3334
}
3435

3536
public function testToOptionArray()
3637
{
37-
$inputTypesSet = [
38+
39+
$extraValues = [
40+
['value' => 'price', 'label' => 'Price'],
41+
['value' => 'media_image', 'label' => 'Media Image']
42+
];
43+
$inputTypesSet = $this->getInputTypeSet();
44+
$inputTypesSet = array_merge($inputTypesSet, $extraValues);
45+
46+
$this->registry->expects($this->once())->method('registry');
47+
$this->registry->expects($this->once())->method('register');
48+
$this->assertEquals($inputTypesSet, $this->inputtypeModel->toOptionArray());
49+
}
50+
51+
private function getInputTypeSet()
52+
{
53+
return [
3854
['value' => 'text', 'label' => 'Text Field'],
3955
['value' => 'textarea', 'label' => 'Text Area'],
4056
['value' => 'texteditor', 'label' => 'Text Editor'],
4157
['value' => 'date', 'label' => 'Date'],
4258
['value' => 'boolean', 'label' => 'Yes/No'],
4359
['value' => 'multiselect', 'label' => 'Multiple Select'],
44-
['value' => 'select', 'label' => 'Dropdown'],
45-
['value' => 'price', 'label' => 'Price'],
46-
['value' => 'media_image', 'label' => 'Media Image'],
60+
['value' => 'select', 'label' => 'Dropdown']
4761
];
48-
49-
$this->registry->expects($this->once())->method('registry');
50-
$this->registry->expects($this->once())->method('register');
51-
$this->assertEquals($inputTypesSet, $this->inputtypeModel->toOptionArray());
5262
}
5363
}

0 commit comments

Comments
 (0)