public function testToOptionArray() { $allOptions = [['types' => [['disabled' => false, 'label' => 'typeLabel', 'name' => 'typeName']], 'label' => 'optionLabel'], ['types' => [['disabled' => true]], 'label' => 'optionLabelDisabled']]; $expect = [['value' => '', 'label' => __('-- Please select --')], ['label' => 'optionLabel', 'optgroup-name' => 'optionLabel', 'value' => [['label' => 'typeLabel', 'value' => 'typeName']]]]; $this->productOptionConfig->expects($this->any())->method('getAll')->will($this->returnValue($allOptions)); $this->assertEquals($expect, $this->model->toOptionArray()); }
public function testModifyMeta() { $this->priceCurrency->expects($this->any())->method('getCurrencySymbol')->willReturn('$'); $this->productOptionsConfigMock->expects($this->once())->method('getAll')->willReturn([]); $this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $this->getModel()->modifyMeta([])); }