public function testGetLabelsCollectionForSystemConfiguration() { $defaultLabel = (string) new \Magento\Framework\Phrase('-- No Theme --'); $data = ['value' => '1', 'label' => 'Label1']; $this->labelList->expects($this->once())->method('getLabels')->willReturn([$data]); $result = $this->model->getLabelsCollectionForSystemConfiguration(); $this->assertTrue(is_array($result)); $this->assertEquals(2, count($result)); $this->assertEquals($defaultLabel, $result[0]['label']); $this->assertEquals($data['label'], $result[1]['label']); }
/** * @param array $options * @param array $expected * @return void * @dataProvider getOptionsDataProvider */ public function testToOptionArray(array $options, array $expected) { $this->listMock->expects($this->once())->method('getLabels')->willReturn($options); $this->assertSame($expected, $this->object->toOptionArray()); }
public function testToOptionArray() { $list = [['value' => 44, 'label' => 'label']]; $this->listMock->expects($this->once())->method('getLabels')->willReturn($list); $this->assertEquals($list, $this->model->toOptionArray()); }