function it_launches_a_background_process_from_an_operation($jobLauncher, $jobInstanceRepo, $tokenStorage, TokenInterface $token, UserInterface $user, AbstractMassEditOperation $operation, JobInstance $jobInstance) { $operation->getJobInstanceCode()->willReturn('mass_classify'); $jobInstanceRepo->findOneBy(['code' => 'mass_classify'])->willReturn($jobInstance); $operation->finalize()->shouldBeCalled(); $operation->getBatchConfig()->willReturn(['foo' => 'bar', 'pomf' => 'thud']); $tokenStorage->getToken()->willReturn($token); $token->getUser()->willReturn($user); $jobLauncher->launch($jobInstance, $user, ['foo' => 'bar', 'pomf' => 'thud']); $this->launch($operation); }
/** * {@inheritdoc} */ public function getBatchConfig() { $config = json_decode(stripslashes(parent::getBatchConfig()), true); $config['locale'] = $this->userContext->getUiLocale()->getCode(); return addslashes(json_encode($config)); }