|
7 | 7 | class RoboFile extends \Robo\Tasks
|
8 | 8 | {
|
9 | 9 | // define public methods as commands
|
10 |
| - public function prepare() |
| 10 | + public function prepareOld() |
11 | 11 | {
|
12 | 12 | $config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
|
13 | 13 |
|
14 | 14 | $config['name'] = 'codeception/phpunit-wrapper-test';
|
15 | 15 | $config['require-dev']['codeception/codeception'] = getenv('CODECEPTION_VERSION');
|
16 | 16 | $config['replace'] = ['codeception/phpunit-wrapper' => '*'];
|
17 | 17 |
|
18 |
| - file_put_contents(__DIR__ . '/composer.json', json_encode($config)); |
| 18 | + file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
19 | 19 | }
|
20 | 20 |
|
| 21 | + public function prepareDependencies() |
| 22 | + { |
| 23 | + $config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true); |
| 24 | + |
| 25 | + $config['name'] = 'codeception/phpunit-wrapper-test'; |
| 26 | + $config['require-dev']['codeception/codeception'] = getenv('CODECEPTION_VERSION'); |
| 27 | + $config['require-dev']['codeception/module-asserts'] = '^1.0'; |
| 28 | + $config['require-dev']['codeception/module-cli'] = '^1.0'; |
| 29 | + $config['require-dev']['codeception/module-db'] = '^1.0'; |
| 30 | + $config['require-dev']['codeception/module-filesystem'] = '^1.0'; |
| 31 | + $config['require-dev']['codeception/module-phpbrowser'] = '^1.0.3'; |
| 32 | + $config['require-dev']['codeception/util-universalframework'] = '*'; |
| 33 | + $config['replace'] = ['codeception/phpunit-wrapper' => '*']; |
| 34 | + |
| 35 | + file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 36 | + } |
| 37 | + |
| 38 | + public function prepareTests() |
| 39 | + { |
| 40 | + $this->_copyDir(__DIR__ . '/vendor/codeception/codeception/tests', __DIR__ . '/tests'); |
| 41 | + $this->_copy(__DIR__ . '/vendor/codeception/codeception/codeception.yml', __DIR__ .'/codeception.yml'); |
| 42 | + $this->_symlink(__DIR__ . '/vendor/bin/codecept', __DIR__ . '/codecept'); |
| 43 | + } |
| 44 | + |
| 45 | + public function prepareTestAutoloading() |
| 46 | + { |
| 47 | + $config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true); |
| 48 | + $config['autoload-dev'] = [ |
| 49 | + 'classmap' => [ |
| 50 | + 'tests/cli/_steps', |
| 51 | + 'tests/data/DummyClass.php', |
| 52 | + 'tests/data/claypit/tests/_data' |
| 53 | + ] |
| 54 | + ]; |
| 55 | + file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 56 | + } |
| 57 | + |
| 58 | + |
21 | 59 | public function test($params)
|
22 | 60 | {
|
23 | 61 | return $this->taskExec(__DIR__ . '/vendor/bin/codecept run ' . $params)
|
|
0 commit comments