Skip to content

Commit cf01abc

Browse files
committed
AC-15051:[CE] PHPUnit 12: Upgrade Product Types related test cases
1 parent 421bc6d commit cf01abc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/code/Magento/Catalog/Test/Unit/Helper/ProductTestHelper.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)