Skip to content

Commit

Permalink
ignore coverage for test code
Browse files Browse the repository at this point in the history
  • Loading branch information
PBXg33k committed May 12, 2018
1 parent b0a91be commit 12818d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Command/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ abstract protected function initializeService();

protected function configure()
{
// @codeCoverageIgnoreStart
if (!$this->infoService) {
$this->initializeService();
}
Expand All @@ -41,15 +42,18 @@ protected function configure()
->addOption('debug', 'd', InputOption::VALUE_NONE, 'Enables debug mode');

parent::configure();
// @codeCoverageIgnoreEnd
}

protected function initialize(InputInterface $input, OutputInterface $output)
{
// @codeCoverageIgnoreStart
if ($input->getOption('debug')) {
Debug::enable();
}

parent::initialize($input, $output);
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -60,13 +64,15 @@ protected function initialize(InputInterface $input, OutputInterface $output)
*/
protected function generateTableForSearchResult($collection, $columns, Table $table)
{
// @codeCoverageIgnoreStart
$table->setHeaders(array_values($columns));

foreach ($collection as $service => $serviceResult) {
$table = $this->generateTableRows($serviceResult, $columns, $table);
}

return $table;
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -77,6 +83,7 @@ protected function generateTableForSearchResult($collection, $columns, Table $ta
*/
protected function generateTableRows($collection, $columns, Table $table)
{
// @codeCoverageIgnoreStart
foreach ($collection as $item) {
$row = [];

Expand All @@ -88,5 +95,6 @@ protected function generateTableRows($collection, $columns, Table $table)
}

return $table;
// @codeCoverageIgnoreEnd
}
}
7 changes: 5 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@

class Configuration implements ConfigurationInterface
{

/**
* Generates the configuration tree builder.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/
public function getConfigTreeBuilder()
{
// @codeCoverageIgnoreStart
throw new InvalidConfigurationException("You must override getConfigTreeBuilder and call buildConfigTreeBuilder");
// @codeCoverageIgnoreEnd
}

protected function buildConfigTreeBuilder(TreeBuilder $treeBuilder, $rootName)
{
// @codeCoverageIgnoreStart
$rootNode = $treeBuilder->root($rootName);

// @codingStandardsIgnoreStart
$rootNode
->children()
->booleanNode('init_services')->defaultTrue()->end()
Expand All @@ -44,7 +47,7 @@ protected function buildConfigTreeBuilder(TreeBuilder $treeBuilder, $rootName)
->end()
;

// @codingStandardsIgnoreEnd
return $treeBuilder;
// @codeCoverageIgnoreEnd
}
}

0 comments on commit 12818d9

Please sign in to comment.