Exemple #1
0
 public function testGetTypes()
 {
     $label = 'someLabel';
     $value = 'someValue';
     $this->typeModel->expects($this->once())->method('toOptionArray')->will($this->returnValue([['label' => $label, 'value' => $value]]));
     $this->typeConverter->expects($this->once())->method('createDataFromModel')->will($this->returnValue($this->type));
     $this->assertEquals([$this->type], $this->model->getTypes());
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 public function getTypes()
 {
     $optionList = $this->type->toOptionArray();
     /** @var Type[] $typeDtoList */
     $typeDtoList = [];
     foreach ($optionList as $option) {
         $typeDtoList[] = $this->typeConverter->createDataFromModel($option);
     }
     return $typeDtoList;
 }