How to get to the url generator in Yves dependency provider


#1

Question about the Demoshop.

I’m trying to test Checkout with Behat.
Currently, StepFactory fails on this code:

    /**
     * @return \Pyz\Yves\Application\Business\Model\FlashMessengerInterface
     */
    protected function getFlashMessenger()
    {
        return $this->getApplication()['flash_messenger'];
    }

    /**
     * @return \Symfony\Component\Form\FormFactoryInterface
     */
    protected function getFormFactory()
    {
        return $this->getApplication()['form.factory'];
    }

    /**
     * @return \Symfony\Component\Routing\Generator\UrlGeneratorInterface
     */
    protected function getUrlGenerator()
    {
        return $this->getApplication()['url_generator'];
    }

I tried to change that and use DependencyProvider for Yves. What is the proper way of getting an instance of the url generator or flash messenger within provideDependencies method?


#2

Hi mheki,

Have you tried using clients for this? You can use the UrlClient and MessengerClient for this.