Permalink
Browse files

test that services are resolved

  • Loading branch information...
1 parent 309a3a2 commit c94aac0b864e9de4b871ce305a468d198e88113f @arnaud-lb arnaud-lb committed Jan 8, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 Tests/DependencyInjection/ExerciseHTMLPurifierExtensionTest.php
@@ -106,6 +106,30 @@ public function testShouldLoadCustomConfiguration()
));
}
+ public function testShouldResolveServices()
+ {
+ $container = new ContainerBuilder;
+ $extension = new ExerciseHTMLPurifierExtension();
+
+ $config = array(
+ 'simple' => array(
+ 'AutoFormat.Custom' => array('@service_container'),
+ ),
+ );
+
+ $this->extension->load(array($config), $this->container);
+
+ $definition = $this->container->getDefinition('exercise_html_purifier.config.simple');
+ $calls = $definition->getMethodCalls();
+
+ $call = $calls[0];
+ $this->assertSame('loadArray', $call[0]);
+
+ $args = $call[1];
+
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Reference', $args[0]['AutoFormat.Custom'][0]);
+ }
+
/**
* Assert that the named config definition extends the default profile and
* loads the given options.

0 comments on commit c94aac0

Please sign in to comment.