Example #1
0
 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']);
 }
Example #2
0
 /**
  * @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());
 }
Example #3
0
 public function testToOptionArray()
 {
     $list = [['value' => 44, 'label' => 'label']];
     $this->listMock->expects($this->once())->method('getLabels')->willReturn($list);
     $this->assertEquals($list, $this->model->toOptionArray());
 }
Example #4
0
 /**
  * Get options
  *
  * @return array
  */
 public function toOptionArray()
 {
     $options[] = ['label' => 'Default', 'value' => ''];
     return array_merge($options, $this->themeList->getLabels());
 }
Example #5
0
 /**
  * Get options
  *
  * @return array
  */
 public function toOptionArray()
 {
     $options[] = ['label' => '', 'value' => ''];
     return $options + $this->themeList->getLabels();
 }
Example #6
0
 /**
  * Return list of themes
  *
  * @return array
  */
 public function toOptionArray()
 {
     return $this->list->getLabels();
 }