-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linting and documenting the code (#23)
- Adding docblocks - Fixing some coding style and linting issues - Rearranging and improving the Composer file - Adding a Database class to handle database operations and checks - Removing the cleanup class as it was unused - Fixing readme a bit
- Loading branch information
1 parent
065b44b
commit bbfc524
Showing
15 changed files
with
551 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,37 +3,50 @@ | |
"description": "Strap the WordPress PHPUnit tests library onto your plugin or theme with this handy Composer package.", | ||
"version": "0.1.4", | ||
"type": "library", | ||
"license": "AGPL-3.0-or-later", | ||
"keywords": ["wordpress", "phpunit", "testing", "dev"], | ||
"homepage": "https://github.com/aldavigdis/wp-tests-strapon", | ||
"support": { | ||
"issues": "https://github.com/aldavigdis/wp-tests-strapon/issues", | ||
"source": "https://github.com/aldavigdis/wp-tests-strapon", | ||
"email": "[email protected]" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Alda Vigdís Skarphéðinsdóttir", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"composer-plugin-api": "^2.6", | ||
"yoast/phpunit-polyfills": "^2.0", | ||
"simoneast/simple-ansi-colors": "^1.0" | ||
"simoneast/simple-ansi-colors": "^1.0", | ||
"phpunit/phpunit": "^9.0 || ^10.0" | ||
}, | ||
"require-dev": { | ||
"composer/composer": "^2.7", | ||
"psy/psysh": "^0.12.0", | ||
"wp-coding-standards/wpcs": "^3.0", | ||
"squizlabs/php_codesniffer": "^3.8", | ||
"phpunit/phpunit": "^10.0" | ||
"phpunit/phpunit": "^10.0", | ||
"slevomat/coding-standard": "^8.14", | ||
"phpcompatibility/php-compatibility": "^9.3" | ||
|
||
}, | ||
"license": "AGPL-3.0-or-later", | ||
"autoload": { | ||
"psr-4": { | ||
"Aldavigdis\\WpTestsStrapon\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Alda Vigdís Skarphéðinsdóttir", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"extra": { | ||
"class": "Aldavigdis\\WpTestsStrapon\\StraponMain" | ||
"scripts": { | ||
"test": "./vendor/bin/phpunit --testdox --display-warnings --display-notices", | ||
"lint:check": "vendor/bin/phpcs src/ bootstrap.php tests/", | ||
"lint:fix": "vendor/bin/phpcbf src/ bootstrap.php tests/" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,46 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WP-Tests-Strapon"> | ||
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound"> | ||
<exclude-pattern>./supressors/*</exclude-pattern> | ||
|
||
<rule ref="PHPCompatibility"> | ||
</rule> | ||
<config name="testVersion" value="8.2-"/> | ||
|
||
<!-- Enforce strict type decleration at top of all PHP files --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> | ||
<properties> | ||
<property name="spacesCountAroundEqualsSign" value="0" /> | ||
<property name="linesCountBeforeDeclare" value="1" /> | ||
<property name="linesCountAfterDeclare" value="1" /> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Enforce type hinting for function parameters --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"> | ||
</rule> | ||
|
||
<!-- Enforce type hinting for function return values --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"> | ||
</rule> | ||
|
||
<!-- Disallow "sloppy" equals operators --> | ||
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"> | ||
</rule> | ||
|
||
<!-- | ||
Exclude the vendor direcotry because of course | ||
--> | ||
<exclude-pattern>./vendor/*</exclude-pattern> | ||
|
||
<!-- | ||
Excluding commenting rules from tests, as we are using TestDox instead | ||
--> | ||
<rule ref="Squiz.Commenting.ClassComment.Missing"> | ||
<exclude-pattern>./tests/**</exclude-pattern> | ||
<exclude-pattern>./supressors/**</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FunctionComment.Missing"> | ||
<exclude-pattern>./tests/**</exclude-pattern> | ||
<exclude-pattern>./supressors/**</exclude-pattern> | ||
</rule> | ||
|
||
</ruleset> |
Oops, something went wrong.