/** * Configures the facades and registers the aliases loader, when * activated. */ public function initialize() { Facade::setContainer($this->getContainer()); if (null !== ($loader = $this->getLoader())) { $loader->register(); } }
/** @test */ public function it_accepts_container_accessors() { $container = $this->prophesize(ContainerInterface::class); $container->has('facade_service')->willReturn(true); $container->get('facade_service')->shouldBeCalled()->willReturn(new Dummy()); Facade::setContainer($container->reveal()); Fixture\ContainerFacade::foo(); }
/** @test */ public function it_accepts_container_accessors() { $container = $this->prophet->prophesize('Symfony\\Component\\DependencyInjection\\Container'); $container->has('facade_service')->willReturn(true); $container->get('facade_service')->shouldBeCalled()->willReturn(new Dummy()); Facade::setContainer($container->reveal()); Fixture\ContainerFacade::foo(); }