mirror of
https://fast.feibisi.com/https://github.com/wp-cli/scaffold-command.git
synced 2025-10-04 17:01:28 +08:00
Merge pull request #354 from wp-cli/dependabot/composer/wp-cli/wp-cli-tests-tw-5
This commit is contained in:
commit
28abef8ddc
5 changed files with 22 additions and 6 deletions
|
@ -16,14 +16,15 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"wp-cli/extension-command": "^1.2 || ^2",
|
||||
"wp-cli/wp-cli-tests": "^4"
|
||||
"wp-cli/wp-cli-tests": "^5"
|
||||
},
|
||||
"config": {
|
||||
"process-timeout": 7200,
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||
"johnpbloch/wordpress-core-installer": true
|
||||
"johnpbloch/wordpress-core-installer": true,
|
||||
"phpstan/extension-installer": true
|
||||
},
|
||||
"lock": false
|
||||
},
|
||||
|
@ -59,12 +60,14 @@
|
|||
"behat-rerun": "rerun-behat-tests",
|
||||
"lint": "run-linter-tests",
|
||||
"phpcs": "run-phpcs-tests",
|
||||
"phpstan": "run-phpstan-tests",
|
||||
"phpcbf": "run-phpcbf-cleanup",
|
||||
"phpunit": "run-php-unit-tests",
|
||||
"prepare-tests": "install-package-tests",
|
||||
"test": [
|
||||
"@lint",
|
||||
"@phpcs",
|
||||
"@phpstan",
|
||||
"@phpunit",
|
||||
"@behat"
|
||||
]
|
||||
|
|
|
@ -231,7 +231,7 @@ Feature: WordPress code scaffolding
|
|||
"""
|
||||
And the {PLUGIN_DIR}/hello-world/.phpcs.xml.dist file should contain:
|
||||
"""
|
||||
<config name="testVersion" value="5.6-"/>
|
||||
<config name="testVersion" value="7.2-"/>
|
||||
"""
|
||||
And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain:
|
||||
"""
|
||||
|
|
13
phpstan.neon.dist
Normal file
13
phpstan.neon.dist
Normal file
|
@ -0,0 +1,13 @@
|
|||
parameters:
|
||||
level: 9
|
||||
paths:
|
||||
- src
|
||||
- scaffold-command.php
|
||||
scanDirectories:
|
||||
- vendor/wp-cli/wp-cli/php
|
||||
scanFiles:
|
||||
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
|
||||
treatPhpDocTypesAsCertain: false
|
||||
ignoreErrors:
|
||||
- identifier: missingType.parameter
|
||||
- identifier: missingType.return
|
|
@ -875,7 +875,7 @@ class Scaffold_Command extends WP_CLI_Command {
|
|||
$wp_versions_to_test = [];
|
||||
// Parse plugin readme.txt
|
||||
if ( file_exists( "{$target_dir}/readme.txt" ) ) {
|
||||
$readme_content = file_get_contents( "{$target_dir}/readme.txt" );
|
||||
$readme_content = (string) file_get_contents( "{$target_dir}/readme.txt" );
|
||||
|
||||
preg_match( '/Requires at least\:(.*)\n/m', $readme_content, $matches );
|
||||
if ( isset( $matches[1] ) && $matches[1] ) {
|
||||
|
@ -1045,7 +1045,7 @@ class Scaffold_Command extends WP_CLI_Command {
|
|||
/**
|
||||
* Extracts dashicon name when provided or return null otherwise.
|
||||
*
|
||||
* @param array $assoc_args
|
||||
* @param array{dashicon?: string} $assoc_args
|
||||
* @return string|null
|
||||
*/
|
||||
private function extract_dashicon( $assoc_args ) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<!-- Rules: Check PHP version compatibility -->
|
||||
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
|
||||
<config name="testVersion" value="5.6-"/>
|
||||
<config name="testVersion" value="7.2-"/>
|
||||
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
|
||||
<rule ref="PHPCompatibilityWP"/>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue