ConsoleTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use Symfony\Component\Console\Application;
  3. use Symfony\Component\Console\Tester\CommandTester;
  4. use Chash\Command\Files\CleanConfigFilesCommand;
  5. class ConsoleTest extends PHPUnit_Framework_TestCase
  6. {
  7. public function setUp()
  8. {
  9. $configurationFileContent = file_get_contents(__DIR__.'/../Resources/configuration.php');
  10. }
  11. public function testListCommand()
  12. {
  13. $application = new Application();
  14. $helpers = array(
  15. 'configuration' => new Chash\Helpers\ConfigurationHelper()
  16. );
  17. $helperSet = $application->getHelperSet();
  18. foreach ($helpers as $name => $helper) {
  19. $helperSet->set($helper, $name);
  20. }
  21. //$application->add(new CleanConfigFilesCommand());
  22. //$command = $application->find('files:clean_config_files');
  23. //$this->assertEquals('Chash\Command\Files\CleanConfigFilesCommand', get_class($command));
  24. /* $commandTester = new CommandTester($command);
  25. $returnCode = $commandTester->execute(
  26. array(
  27. 'command' => $command->getName(),
  28. '--conf' => 'chamilo/config/configuration.php'
  29. )
  30. );*/
  31. // var_dump(realpath(__DIR__.'/../../Resources/configuration.php'));
  32. // $this->assertRegExp('/11/', $commandTester->getDisplay());
  33. }
  34. }