RoboFile.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * This is project's console commands configuration for Robo task runner.
  4. *
  5. * @see http://robo.li/
  6. */
  7. class RoboFile extends \Robo\Tasks
  8. {
  9. // define public methods as commands
  10. public function prepareDependencies()
  11. {
  12. $config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
  13. $config['name'] = 'codeception/phpunit-wrapper-test';
  14. $config['require-dev']['codeception/codeception'] = getenv('CODECEPTION_VERSION');
  15. $config['require-dev']['codeception/module-asserts'] = 'dev-master';
  16. $config['require-dev']['codeception/module-cli'] = '*';
  17. $config['require-dev']['codeception/module-db'] = '*';
  18. $config['require-dev']['codeception/module-filesystem'] = '*';
  19. $config['require-dev']['codeception/module-phpbrowser'] = '*';
  20. $config['require-dev']['codeception/util-universalframework'] = '*';
  21. $config['replace'] = ['codeception/phpunit-wrapper' => '*'];
  22. file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
  23. }
  24. public function prepareTests()
  25. {
  26. $this->_copyDir(__DIR__ . '/vendor/codeception/codeception/tests', __DIR__ . '/tests');
  27. $this->_copy(__DIR__ . '/vendor/codeception/codeception/codeception.yml', __DIR__ .'/codeception.yml');
  28. $this->_symlink(__DIR__ . '/vendor/bin/codecept', __DIR__ . '/codecept');
  29. }
  30. public function prepareTestAutoloading()
  31. {
  32. $config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
  33. $config['autoload-dev'] = [
  34. 'classmap' => [
  35. 'tests/cli/_steps',
  36. 'tests/data/DummyClass.php',
  37. 'tests/data/claypit/tests/_data'
  38. ]
  39. ];
  40. file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
  41. }
  42. }