Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit e360095

Browse files
committed
Test 7.1 branch against Codeception 4.2
1 parent fa35d3c commit e360095

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
- name: Prepare dependencies
2828
run: |
2929
wget https://github.com/consolidation/Robo/releases/download/1.4.12/robo.phar
30-
php robo.phar prepare
31-
composer update
30+
php robo.phar prepare:old
31+
composer update --prefer-source
3232
3333
- name: Run test suite
3434
run: |
@@ -39,9 +39,20 @@ jobs:
3939
4040
- name: run tests with 2.5 branch
4141
run: |
42-
CODECEPTION_VERSION=2.5.x-dev php robo.phar prepare
43-
composer update
42+
CODECEPTION_VERSION=2.5.x-dev php robo.phar prepare:old
43+
composer update --prefer-source
4444
php robo.phar test cli
4545
php robo.phar test "unit -g core"
4646
php robo.phar test "tests/unit/Codeception/Constraints/"
4747
php robo.phar test "tests/unit/Codeception/Module/AssertsTest.php"
48+
49+
- name: run tests with Codeception 4.2
50+
run: |
51+
CODECEPTION_VERSION="dev-4.2-backport-useless-test-event as 4.2.0" php robo.phar prepare:dependencies
52+
composer update --prefer-source
53+
php robo.phar prepare:tests
54+
php robo.phar prepare:test-autoloading
55+
composer dump-autoload
56+
php ./codecept run -c vendor/codeception/module-asserts/
57+
php ./codecept run unit -g core
58+
php ./codecept run cli

RoboFile.php

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,55 @@
77
class RoboFile extends \Robo\Tasks
88
{
99
// define public methods as commands
10-
public function prepare()
10+
public function prepareOld()
1111
{
1212
$config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
1313

1414
$config['name'] = 'codeception/phpunit-wrapper-test';
1515
$config['require-dev']['codeception/codeception'] = getenv('CODECEPTION_VERSION');
1616
$config['replace'] = ['codeception/phpunit-wrapper' => '*'];
1717

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));
1919
}
2020

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+
2159
public function test($params)
2260
{
2361
return $this->taskExec(__DIR__ . '/vendor/bin/codecept run ' . $params)

0 commit comments

Comments
 (0)