Skip to content

Commit de61033

Browse files
Add PHPUnit configuration for testing (#1)
Add PHPUnit configuration file for testing setup - Created phpunit.xml to define testing environment and settings. - Configured test suite to include tests from the 'tests' directory. - Set source restrictions to include only the 'src' directory. - Enabled strict checks for coverage metadata, deprecations, warnings, and risky tests.
1 parent 686e05f commit de61033

File tree

7 files changed

+6112
-39
lines changed

7 files changed

+6112
-39
lines changed

.github/workflows/close-pull-request.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
2+
.phpunit.cache/
23
.vscode
3-
vendor/
4+
vendor/

co-phpunit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
6868
require $prepend;
6969
}
7070
})();
71+
! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
7172
require PHPUNIT_COMPOSER_INSTALL;
7273
$code = 0;
7374
Swoole\Coroutine::set(['hook_flags' => SWOOLE_HOOK_ALL, 'exit_condition' => function () {

composer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,20 @@
4545
"branch-alias": {
4646
"dev-master": "3.1-dev"
4747
}
48+
},
49+
"repositories": {
50+
"opencodeco": {
51+
"type": "composer",
52+
"url": "https://composer.opencodeco.dev"
53+
}
54+
},
55+
"scripts": {
56+
"test": "./co-phpunit --exclude-group NonCoroutine"
57+
},
58+
"require-dev": {
59+
"mockery/mockery": "^1.6",
60+
"hyperf/di": "^3.1",
61+
"swoole/ide-helper": "^5.1",
62+
"hyperf/config": "^3.1"
4863
}
4964
}

0 commit comments

Comments
 (0)