/** * @expectedException \Oro\Bundle\ConfigBundle\Exception\UnexpectedTypeException * @expectedExceptionMessage Expected argument of type "Oro\Bundle\ConfigBundle\Config\DataTransformerInterface" */ public function testGetDataTransformerWithUnexpectedType() { $this->container->expects($this->once())->method('get')->with('test.service')->will($this->returnValue(new \stdClass())); $config = ['fields' => ['test_key' => ['data_transformer' => 'test.service']]]; $configBag = new ConfigBag($config, $this->container); $configBag->getDataTransformer('test_key'); }
/** * {@inheritdoc} */ public function getDataTransformer($key) { return $this->configBag->getDataTransformer($key); }