File tree Expand file tree Collapse file tree 3 files changed +62
-91
lines changed
app/code/Magento/Catalog/Test/Unit
Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 3 files changed +62
-91
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -79,6 +79,21 @@ class ProductTestHelper extends Product
7979 */
8080 private $ dataCallCount = 0 ;
8181
82+ /**
83+ * @var array
84+ */
85+ private $ customAttributes = [];
86+
87+ /**
88+ * Initialize resources
89+ *
90+ * @return void
91+ */
92+ protected function _construct ()
93+ {
94+ // Mock implementation - no actual resource initialization needed
95+ }
96+
8297 /**
8398 * Constructor
8499 *
@@ -675,4 +690,49 @@ public function getWebsiteIds()
675690 {
676691 return $ this ->getData ('website_ids ' ) ?: [];
677692 }
693+
694+ /**
695+ * Get custom attribute value
696+ *
697+ * @param string $attributeCode
698+ * @return mixed
699+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
700+ */
701+ public function getCustomAttribute ($ attributeCode )
702+ {
703+ return $ this ->customAttributes [$ attributeCode ] ?? null ;
704+ }
705+
706+ /**
707+ * Set custom attribute for testing
708+ *
709+ * @param string $attributeCode
710+ * @param mixed $attribute
711+ * @return $this
712+ */
713+ public function setCustomAttributeForTest ($ attributeCode , $ attribute )
714+ {
715+ $ this ->customAttributes [$ attributeCode ] = $ attribute ;
716+ return $ this ;
717+ }
718+
719+ /**
720+ * Get product options
721+ *
722+ * @return array|null
723+ */
724+ public function getOptions ()
725+ {
726+ return $ this ->getData ('options ' );
727+ }
728+
729+ /**
730+ * Get attribute set ID
731+ *
732+ * @return int|null
733+ */
734+ public function getAttributeSetId ()
735+ {
736+ return $ this ->getData ('attribute_set_id ' );
737+ }
678738}
Original file line number Diff line number Diff line change 99
1010use Magento \Catalog \Api \Data \ProductInterface ;
1111use Magento \Catalog \Model \Locator \LocatorInterface ;
12- use Magento \Catalog \Test \Unit \Helper \ProductInterfaceTestHelper ;
12+ use Magento \Catalog \Test \Unit \Helper \ProductTestHelper ;
1313use Magento \Store \Test \Unit \Helper \StoreInterfaceTestHelper ;
1414use Magento \Framework \Stdlib \ArrayManager ;
1515use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
@@ -58,7 +58,7 @@ protected function setUp(): void
5858 $ this ->objectManager = new ObjectManager ($ this );
5959 $ this ->locatorMock = $ this ->createMock (LocatorInterface::class);
6060 $ this ->productMock = $ this ->createPartialMock (
61- ProductInterfaceTestHelper ::class,
61+ ProductTestHelper ::class,
6262 [
6363 'getId ' ,
6464 'getTypeId ' ,
You can’t perform that action at this time.
0 commit comments