1111use Magento \Catalog \Model \ResourceModel \Eav \Attribute ;
1212use Magento \Framework \ObjectManagerInterface ;
1313use Magento \Swatches \Model \ResourceModel \Swatch as SwatchResource ;
14+ use Magento \Swatches \Model \Swatch ;
1415use Magento \TestFramework \Helper \Bootstrap ;
1516use Magento \TestFramework \Interception \PluginList ;
1617use PHPUnit \Framework \TestCase ;
@@ -49,7 +50,7 @@ protected function setUp(): void
4950 /**
5051 * @return void
5152 */
52- public function testEavAttributePluginIsRegistered ()
53+ public function testEavAttributePluginIsRegistered (): void
5354 {
5455 $ pluginInfo = $ this ->objectManager ->get (PluginList::class)->get (Attribute::class);
5556 $ this ->assertSame (EavAttribute::class, $ pluginInfo ['save_swatches_option_params ' ]['instance ' ]);
@@ -67,7 +68,7 @@ public function testChangeAttributeToDropdown(): void
6768 unset($ options [0 ]);
6869 $ optionsIds = $ this ->collectOptionsIds ($ options );
6970 $ attribute ->addData ($ this ->prepareOptions ($ options ));
70- $ attribute ->setData (' swatch_input_type ' , ' dropdown ' );
71+ $ attribute ->setData (Swatch:: SWATCH_INPUT_TYPE_KEY , Swatch:: SWATCH_INPUT_TYPE_DROPDOWN );
7172 $ attribute ->beforeSave ();
7273 $ this ->assertEmpty ($ this ->fetchSwatchOptions ($ optionsIds ), 'Swatch options were not deleted ' );
7374 }
@@ -80,7 +81,6 @@ public function testChangeAttributeToDropdown(): void
8081 */
8182 private function prepareOptions (array $ options ): array
8283 {
83- unset($ options [0 ]);
8484 foreach ($ options as $ key => $ option ) {
8585 $ preparedOptions ['option ' ]['order ' ][$ option ->getValue ()] = $ key ;
8686 $ preparedOptions ['option ' ]['value ' ][$ option ->getValue ()] = [$ option ->getLabel ()];
0 commit comments