File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
app/code/Magento/Catalog/Test/Unit/Helper Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -799,11 +799,26 @@ public function setExtensionAttributes($extensionAttributes): self
799799 public function setOptions (?array $ options = null ): self
800800 {
801801 $ this ->data ['options ' ] = $ options ;
802+ if (!isset ($ this ->data ['product_data ' ])) {
803+ $ this ->data ['product_data ' ] = [];
804+ }
805+ $ this ->data ['product_data ' ]['options ' ] = $ options ;
802806 $ this ->setOptionsCalled = true ;
803807 $ this ->setOptionsParams = $ options ;
804808 return $ this ;
805809 }
806810
811+ /**
812+ * Get options for testing
813+ *
814+ * @return array
815+ */
816+ public function getOptions ()
817+ {
818+ $ options = $ this ->data ['options ' ] ?? ($ this ->data ['product_data ' ]['options ' ] ?? []);
819+ return is_array ($ options ) ? $ options : [];
820+ }
821+
807822 /**
808823 * Custom getCustomOption method for testing
809824 *
You can’t perform that action at this time.
0 commit comments