|
25 | 25 | "require-dev": { |
26 | 26 | "automattic/vipwpcs": "^3", |
27 | 27 | "php-parallel-lint/php-parallel-lint": "^1.0", |
28 | | - "phpcompatibility/phpcompatibility-wp": "^2.1" |
| 28 | + "phpcompatibility/phpcompatibility-wp": "^2.1", |
| 29 | + "phpunit/phpunit": "^9.6", |
| 30 | + "yoast/wp-test-utils": "^1.2" |
| 31 | + }, |
| 32 | + "autoload-dev": { |
| 33 | + "psr-4": { |
| 34 | + "Automattic\\BuddyPressVIPGo\\Tests\\": "tests/" |
| 35 | + } |
29 | 36 | }, |
30 | 37 | "config": { |
31 | 38 | "allow-plugins": { |
|
35 | 42 | "sort-packages": true |
36 | 43 | }, |
37 | 44 | "scripts": { |
38 | | - "cs": [ |
39 | | - "@php ./vendor/bin/phpcs -q" |
40 | | - ], |
41 | | - "cs-fix": [ |
42 | | - "@php ./vendor/bin/phpcbf -q" |
43 | | - ], |
| 45 | + "coverage": "@php ./vendor/bin/phpunit --coverage-html ./build/coverage-html", |
| 46 | + "coverage-ci": "@php ./vendor/bin/phpunit", |
| 47 | + "cs": "@php ./vendor/bin/phpcs -q", |
| 48 | + "cs-fix": "@php ./vendor/bin/phpcbf -q", |
44 | 49 | "i18n": "@php wp i18n make-pot . ./languages/buddypress-vip-go.pot", |
45 | | - "lint": [ |
46 | | - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git" |
47 | | - ], |
48 | | - "lint-ci": [ |
49 | | - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle" |
50 | | - ] |
| 50 | + "lint": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git", |
| 51 | + "lint-ci": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle", |
| 52 | + "test:unit": "@php ./vendor/bin/phpunit --testsuite Unit", |
| 53 | + "test:integration": "wp-env run tests-cli --env-cwd=wp-content/plugins/buddypress-vip-go ./vendor/bin/phpunit --testsuite WP_Tests", |
| 54 | + "test:integration-ms": "wp-env run tests-cli --env-cwd=wp-content/plugins/buddypress-vip-go /bin/bash -c 'WP_MULTISITE=1 ./vendor/bin/phpunit --testsuite WP_Tests'" |
51 | 55 | }, |
52 | 56 | "scripts-descriptions": { |
| 57 | + "coverage": "Run tests with code coverage reporting", |
| 58 | + "coverage-ci": "Run tests with code coverage reporting and send results to stdout", |
53 | 59 | "cs": "Run PHP Code Sniffer", |
54 | 60 | "cs-fix": "Run PHP Code Sniffer and fix violations", |
55 | 61 | "i18n": "Generate a POT file for translation", |
56 | 62 | "lint": "Run PHP linting", |
57 | | - "lint-ci": "Run PHP linting and send results to stdout" |
| 63 | + "lint-ci": "Run PHP linting and send results to stdout", |
| 64 | + "test:unit": "Run unit tests", |
| 65 | + "test:integration": "Run integration tests", |
| 66 | + "test:integration-ms": "Run integration tests in multisite mode" |
58 | 67 | } |
59 | 68 | } |
0 commit comments