Category: symfony-2.8

Symfony2: How can I mock a custom constraint with DI in unit test FormType?

I’m writing unit test for Symfony FormType. By following the article https://symfony.com/doc/2.8/form/unit_testing.html, everything worked very smoothly until I added a custom constraint and that constraint’s Validator had a constructor with an argument, then an error was thrown as below: [ArgumentCountError]…

Fetch parameters.yml within class in symfony 2.8

I’ve got a class where I want to fetch some credentials parameters from parameters.yml file. Here is my code: namespace BackendAdminBundleExchange use SymfonyBundleFrameworkBundleCommandContainerAwareCommand; public function __construct() { $client = $this->getContainer()->getParameter(‘muve_client_id’); $secret = $this->getContainer()->getParameter(‘muve_secret’); } yet I receive this error: Attempted…

How to solve: Installation request for orderly/paypal-ipn-bundle dev-master -> satisfiable by orderly/paypal-ipn-bundle[dev-master]

I am installing a Symfony project when running composer install gives me the following error: I have looked for there and usually recommend updating the symfony version but I cannot update it. In addition, the project is working on other…

Access denied, the user is not fully authenticated; sonata admin on production mode

I keep getting logged out from sonata admin on the editing page of some specific objects. it works fine with ROLE_ADMIN but has a problem with my custom defined role. I had this in config.yml: session: # handler_id set to…