mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
add phpunit
This commit is contained in:
37
Gruntfile.js
37
Gruntfile.js
@@ -21,10 +21,11 @@
|
||||
|
||||
/**
|
||||
* * `grunt` - full build
|
||||
* * `grunt dev` - build only items needed for development
|
||||
* * `grunt offline` - skips *composer install*
|
||||
* * `grunt dev` - build only items needed for development (takes less time)
|
||||
* * `grunt offline` - build but skip *composer install*
|
||||
* * `grant release` - full build plus upgrade packages`
|
||||
* * `grant tests` - build and run tests
|
||||
* * `grant test` - build for test running
|
||||
* * `grant run-tests` - build and run unit and integratino tests
|
||||
*/
|
||||
|
||||
module.exports = function (grunt) {
|
||||
@@ -311,12 +312,12 @@ module.exports = function (grunt) {
|
||||
cp.execSync("node diff --all --vendor", {stdio: 'inherit'});
|
||||
});
|
||||
|
||||
grunt.registerTask("unit-tests", function() {
|
||||
cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/unit", {stdio: 'inherit'});
|
||||
grunt.registerTask("unit-tests-run", function() {
|
||||
cp.execSync("vendor/bin/phpunit --bootstrap=vendor/autoload.php tests/unit", {stdio: 'inherit'});
|
||||
});
|
||||
|
||||
grunt.registerTask("integration-tests", function() {
|
||||
cp.execSync("phpunit --bootstrap=vendor/autoload.php tests/integration", {stdio: 'inherit'});
|
||||
grunt.registerTask("integration-tests-run", function() {
|
||||
cp.execSync("vendor/bin/phpunit --bootstrap=vendor/autoload.php tests/integration", {stdio: 'inherit'});
|
||||
});
|
||||
|
||||
grunt.registerTask("zip", function() {
|
||||
@@ -386,15 +387,29 @@ module.exports = function (grunt) {
|
||||
'clean:release',
|
||||
]);
|
||||
|
||||
grunt.registerTask('tests', [
|
||||
grunt.registerTask('run-tests', [
|
||||
'test',
|
||||
'unit-tests-run',
|
||||
'integration-tests-run',
|
||||
]);
|
||||
|
||||
grunt.registerTask('run-unit-tests', [
|
||||
'composer-dev',
|
||||
'offline',
|
||||
'unit-tests',
|
||||
'integration-tests',
|
||||
'unit-tests-run',
|
||||
]);
|
||||
|
||||
grunt.registerTask('run-integration-tests', [
|
||||
'test',
|
||||
'integration-tests-run',
|
||||
]);
|
||||
|
||||
grunt.registerTask('dev', [
|
||||
'composer-dev',
|
||||
'less',
|
||||
]);
|
||||
|
||||
grunt.registerTask('test', [
|
||||
'composer-dev',
|
||||
'offline',
|
||||
]);
|
||||
};
|
||||
|
||||
10
README.md
10
README.md
@@ -72,18 +72,22 @@ Branches:
|
||||
|
||||
### Running tests (for developers)
|
||||
|
||||
You need to have *phpunit* installed.
|
||||
Before running tests, you need to build for testing:
|
||||
|
||||
```
|
||||
grunt test
|
||||
```
|
||||
|
||||
Unit tests:
|
||||
|
||||
```
|
||||
phpunit --bootstrap=vendor/autoload.php tests/unit
|
||||
vendor/bin/phpunit --bootstrap=vendor/autoload.php tests/unit
|
||||
```
|
||||
|
||||
Integration tests:
|
||||
|
||||
```
|
||||
phpunit --bootstrap=vendor/autoload.php tests/integration
|
||||
vendor/bin/phpunit --bootstrap=vendor/autoload.php tests/integration
|
||||
```
|
||||
|
||||
### How to make a translation
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
"robthree/twofactorauth": "^1.6",
|
||||
"nesbot/carbon": "^2.26"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"": "application/",
|
||||
|
||||
1859
composer.lock
generated
1859
composer.lock
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user