public function testGetEnumChoices() { $enumClass = '\\stdClass'; $expected = ['id' => 'Name']; $this->assertEnumChoices($enumClass); $this->assertEquals($expected, $this->provider->getEnumChoices($enumClass)); }
/** * @param string $enumValueClassName * @param string|null $nullValue * * @return array */ protected function getChoices($enumValueClassName, $nullValue) { $choices = []; if (!empty($nullValue)) { $choices[$nullValue] = $this->translator->trans('oro.entity_extend.datagrid.dictionary.filter.empty'); } if (!empty($enumValueClassName)) { $choices = array_merge($choices, $this->valueProvider->getEnumChoices($enumValueClassName)); } return $choices; }