|
@@ -652,6 +652,23 @@ abstract class AbstractDoctrineExtensionTest extends TestCase
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ public function testSetCustomFunctions()
|
|
|
+ {
|
|
|
+ $container = $this->getContainer(array('YamlBundle'));
|
|
|
+
|
|
|
+ $loader = new DoctrineExtension();
|
|
|
+ $container->registerExtension($loader);
|
|
|
+ $this->loadFromFile($container, 'orm_functions');
|
|
|
+ $container->getCompilerPassConfig()->setOptimizationPasses(array());
|
|
|
+ $container->getCompilerPassConfig()->setRemovingPasses(array());
|
|
|
+ $container->compile();
|
|
|
+
|
|
|
+ $definition = $container->getDefinition('doctrine.orm.default_configuration');
|
|
|
+ $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomStringFunction', array('test_string', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestStringFunction'));
|
|
|
+ $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomNumericFunction', array('test_numeric', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestNumericFunction'));
|
|
|
+ $this->assertDICDefinitionMethodCallOnce($definition, 'addCustomDatetimeFunction', array('test_datetime', 'Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestDatetimeFunction'));
|
|
|
+ }
|
|
|
+
|
|
|
protected function getContainer($bundles = 'YamlBundle', $vendor = null)
|
|
|
{
|
|
|
if (!is_array($bundles)) {
|