/** * @param mixed $expected * @param string $entityName * @param string $fieldName * @param string $parameter * @param mixed|null $default * @dataProvider getConfigValueDataProvider */ public function testGetConfigValue($expected, $entityName, $fieldName, $parameter, $default = null) { if (!is_null($expected)) { $this->assertTrue($this->helper->hasConfig($entityName, $fieldName)); } $this->assertSame($expected, $this->helper->getConfigValue($entityName, $fieldName, $parameter, $default)); }
/** * @param mixed $expected * @param string $entityName * @param string $fieldName * @param string $parameter * @param mixed|null $default * @param bool $hasConfig * @dataProvider getConfigValueDataProvider */ public function testGetConfigValue($expected, $entityName, $fieldName, $parameter, $default, $hasConfig = true) { if (!is_null($expected)) { $this->assertTrue($this->helper->hasConfig($entityName, $fieldName)); } $value = $this->helper->getConfigValue($entityName, $fieldName, $parameter, $default); $this->assertSame($expected, $value); $this->assertSame($value, $this->helper->getConfigValue($entityName, $fieldName, $parameter, $default)); // has config from caches $this->assertEquals($hasConfig, $this->helper->hasConfig($entityName, $fieldName)); }
/** * {@inheritdoc} */ public function supportsNormalization($data, $format = null, array $context = array()) { if (is_object($data)) { $dataClass = ClassUtils::getClass($data); return $this->fieldHelper->hasConfig($dataClass); } return false; }