protected function execute(InputInterface $input, OutputInterface $output) { parent::execute($input, $output); $environment1 = $input->getArgument('env1'); $environment2 = $input->getArgument('env2'); $output->writeln(sprintf("<info>Diff between <comment>%s</comment> and <comment>%s</comment></info>\n", $environment1, $environment2)); $diff = $this->app['configuration']->compareEnvironments($environment1, $environment2); $output->writeln(''); $table = new CliTable($diff); $table->enableFormattingTags()->setHeaders(array($environment1, $environment2))->displayKeys()->setValueRenderingFunction(function ($value) { return $this->formatValue($value); }); $output->writeln($table->render()); }
/** * @dataProvider providerTestDisplayKeys */ public function testDisplayKeys($enableKeys, $expected) { $values = array('key1' => array('a', 'bb'), 'key2' => array(true, 3), array(42, 51), 'key4' => array(null, 12), array(82, 86)); $table = new CliTable($values); $table->setHeaders(array('colA', 'colB')); $result = $table->displayKeys($enableKeys)->render(); $this->assertSame($expected, $result); }