/** * Test ongr:sync:provide:parameter behavior. */ public function testCommand() { $parameter = 'winner'; $parameterValue = 'Red Viper'; $parameterNewValue = 'The Mountain'; $this->pairStorage->expects($this->once())->method('get')->with($this->equalTo($parameter))->willReturn($parameterValue); $this->pairStorage->expects($this->once())->method('set')->with($this->equalTo($parameter), $this->equalTo($parameterNewValue)); $container = new ContainerBuilder(); $container->set('ongr_connections.pair_storage', $this->pairStorage); $command = new SyncParametersCommand(); $command->setContainer($container); $application = new Application(); $application->add($command); $commandForTesting = $application->find('ongr:sync:provide:parameter'); $commandTester = new CommandTester($commandForTesting); $commandTester->execute(['command' => $command->getName(), 'parameter' => $parameter, '--set' => $parameterNewValue]); $this->assertContains('New value written: \'The Mountain\'', $commandTester->getDisplay()); }