Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testContainerShouldHaveAccessToGlobalProvidedDependency()
 {
     $containerGlobals = new ContainerGlobals();
     $containerGlobals[self::TEST_KEY] = self::TEST_VALUE;
     $container = new Container($containerGlobals->getContainerGlobals());
     $this->assertSame(self::TEST_VALUE, $container[self::TEST_KEY]);
 }
 /**
  * @param \Silex\Application $app
  *
  * @return void
  */
 public function register(Application $app)
 {
     $containerGlobals = new ContainerGlobals();
     $containerGlobals[ApplicationConstants::FORM_FACTORY] = $containerGlobals->share(function () use($app) {
         return $app['form.factory'];
     });
 }