Skip to content

Commit f7a91d4

Browse files
author
jdlabails
committed
fix command + atoum
1 parent a85c5fc commit f7a91d4

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

Command/InitCommand.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
4747
}
4848
}
4949

50-
$webServer = $this->getHelperSet()->get('dialog')->ask(
51-
$output,
52-
'Please enter your web server user [www-data:www-data] :',
53-
'www-data:www-data'
54-
);
50+
$question = new Question('Please enter your web server user [www-data:www-data] :', 'www-data:www-data');
51+
$webServer = $this->getHelperSet()->get('question')->ask($input, $output, $question);
5552

5653
$outputExec = [];
5754
exec($installerPath. ' ' . $webServer . ' ' . $reportPath, $outputExec);
58-
5955
$outputExec[] = "\nInstallation done";
60-
6156
$output->writeln($outputExec);
6257
}
6358
}

DependencyInjection/Configuration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ public function getConfigTreeBuilder()
5858
->children()
5959
->booleanNode('enable')->defaultTrue()->end()
6060
->scalarNode('lib')->defaultValue('phpunit')->cannotBeEmpty()->end()
61-
->scalarNode('phpunitTestSuite')->cannotBeEmpty()->end()
62-
->scalarNode('phpunitTestConfig')->cannotBeEmpty()->end()
61+
->scalarNode('phpunitTestSuite')->end()
62+
->scalarNode('phpunitTestConfig')->end()
63+
->scalarNode('atoumPath')->end()
64+
->scalarNode('atoumTestDir')->end()
6365
->end()
6466
->end()
6567

Manager/ProjectAnalyzer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ protected function exploitTestReport()
255255
}
256256
} // phpunit
257257

258-
if ($this->parameters['test']['lib'] == 'atoum') {
258+
if ($this->parameters['test']['lib'] == 'atoum' && count($lines) > 2) {
259259
$nbLines = count($lines);
260+
260261
$res['exeTime'] = explode(':', $lines[$nbLines-2])[1];
261262

262263
//Success (4 tests, 40/40 methods, 0 void method, 0 skipped method, 265 assertions)!

Traits/ScriptBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ function creerAnalyses()
4040
$contentSh = str_replace('%%%pathAtoum%%%', $param['atoumPath'], $contentSh);
4141
$contentSh = str_replace('%%%dirTestAtoum%%%', $param['atoumTestDir'], $contentSh);
4242
// modif atoum.cc.php
43-
$contentAtoumCC = file_get_contents($this->phpDirPath . '/atoum.cc.tpl.php');
44-
$contentAtoumCC = str_replace('%%%projectName%%%', $param['title'], $contentAtoumCC);
45-
$contentAtoumCC = str_replace('%%%ppaPath%%%', $this->dirRoot, $contentAtoumCC);
46-
47-
file_put_contents($this->dirRoot . 'assets/php/atoum.cc.php', $contentAtoumCC);
43+
// $contentAtoumCC = file_get_contents($this->phpDirPath . '/atoum.cc.tpl.php');
44+
// $contentAtoumCC = str_replace('%%%projectName%%%', $param['title'], $contentAtoumCC);
45+
// $contentAtoumCC = str_replace('%%%ppaPath%%%', $this->dirRoot, $contentAtoumCC);
46+
//
47+
// file_put_contents($this->dirRoot . 'assets/php/atoum.cc.php', $contentAtoumCC);
4848
}
4949
break;
5050
case 'cs':

0 commit comments

Comments
 (0)