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

Commit bc588b0

Browse files
authored
8.0 Use tests from Codeception 4.0 branch (#75)
* Test against Codeception 4.0 branch * Got tests working * Fixed build * Don't test constraints They were moved to lib-innerbrowser * Run Asserts tests
1 parent 42bfcb9 commit bc588b0

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
.idea
2-
composer.lock
3-
vendor
1+
/.idea
2+
/composer.lock
3+
/vendor
4+
/tests
5+
/codecept
6+
/codeception.yml

.travis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
language: php
22

33
env:
4-
CODECEPTION_VERSION: '3.0.x-dev'
4+
CODECEPTION_VERSION: '4.0.x-dev'
55

66
php:
77
- 7.2
88
- 7.3
99

1010
before_script:
1111
- wget https://robo.li/robo.phar
12-
- php robo.phar prepare
12+
- php robo.phar prepare:dependencies
1313
- composer update
14+
- php robo.phar prepare:tests
15+
- php robo.phar prepare:test-autoloading
16+
- composer dump-autoload
1417

1518
script:
16-
- php robo.phar test cli
17-
- php robo.phar test "unit -g core"
18-
- php robo.phar test "tests/unit/Codeception/Constraints/"
19-
- php robo.phar test "tests/unit/Codeception/Module/AssertsTest.php"
19+
- php ./codecept run -c vendor/codeception/module-asserts/
20+
- php ./codecept run unit -g core
21+
- php ./codecept run cli

RoboFile.php

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,40 @@
77
class RoboFile extends \Robo\Tasks
88
{
99
// define public methods as commands
10-
public function prepare()
10+
public function prepareDependencies()
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');
16+
$config['require-dev']['codeception/module-asserts'] = 'dev-master';
17+
$config['require-dev']['codeception/module-cli'] = '*';
18+
$config['require-dev']['codeception/module-db'] = '*';
19+
$config['require-dev']['codeception/module-filesystem'] = '*';
20+
$config['require-dev']['codeception/module-phpbrowser'] = '*';
21+
$config['require-dev']['codeception/util-universalframework'] = '*';
1622
$config['replace'] = ['codeception/phpunit-wrapper' => '*'];
1723

18-
file_put_contents(__DIR__ . '/composer.json', json_encode($config));
24+
file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
1925
}
2026

21-
public function test($params)
27+
public function prepareTests()
2228
{
23-
return $this->taskExec(__DIR__ . '/vendor/bin/codecept run ' . $params)
24-
->dir(__DIR__ .'/vendor/codeception/codeception')
25-
->run();
29+
$this->_copyDir(__DIR__ . '/vendor/codeception/codeception/tests', __DIR__ . '/tests');
30+
$this->_copy(__DIR__ . '/vendor/codeception/codeception/codeception.yml', __DIR__ .'/codeception.yml');
31+
$this->_symlink(__DIR__ . '/vendor/bin/codecept', __DIR__ . '/codecept');
2632
}
27-
}
33+
34+
public function prepareTestAutoloading()
35+
{
36+
$config = json_decode(file_get_contents(__DIR__ . '/composer.json'), true);
37+
$config['autoload-dev'] = [
38+
'classmap' => [
39+
'tests/cli/_steps',
40+
'tests/data/DummyClass.php',
41+
'tests/data/claypit/tests/_data'
42+
]
43+
];
44+
file_put_contents(__DIR__ . '/composer.json', json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
45+
}
46+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"sebastian/comparator": "^3.0",
1717
"sebastian/diff": "^3.0"
1818
},
19-
"autoload":{
20-
"psr-4":{
19+
"autoload": {
20+
"psr-4": {
2121
"Codeception\\PHPUnit\\": "src/"
2222
}
2323
},

0 commit comments

Comments
 (0)