Merge branch 'automated-testing' into 3.0
This commit is contained in:
commit
2e5a4dfcbd
5 changed files with 5814 additions and 2 deletions
11
README.md
11
README.md
|
@ -27,6 +27,7 @@ Featured on [wpmudev][wpmudev] — cheers for the review, folks!
|
||||||
* [Features](#features)
|
* [Features](#features)
|
||||||
* [Getting Started](#getting-started)
|
* [Getting Started](#getting-started)
|
||||||
* [Documentation](#documentation)
|
* [Documentation](#documentation)
|
||||||
|
* [Testing](#testing)
|
||||||
* [Acknowledgments](#acknowledgements)
|
* [Acknowledgments](#acknowledgements)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
* [Contact Information](#contact-information)
|
* [Contact Information](#contact-information)
|
||||||
|
@ -58,6 +59,15 @@ This Plugin provides:
|
||||||
|
|
||||||
View the current docs [here][footnotes-docs].
|
View the current docs [here][footnotes-docs].
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
This repo. uses [PHPUnit](phpunit) to run automated tests. To run the full test
|
||||||
|
suite, use `composer run test`.
|
||||||
|
|
||||||
|
Test cases are found in the `tests/` directory.
|
||||||
|
|
||||||
|
PHPUnit settings are available in the file `phpunit.xml`.
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
Huge thanks to every **footnotes** user, contributor, bug reporter, feature
|
Huge thanks to every **footnotes** user, contributor, bug reporter, feature
|
||||||
|
@ -86,6 +96,7 @@ This project is licensed under the [GNU GPL v3][gpl-v3].
|
||||||
[prettier]: https://prettier.io/
|
[prettier]: https://prettier.io/
|
||||||
[eslint]: https://eslint.org/
|
[eslint]: https://eslint.org/
|
||||||
[stylelint]: https://stylelint.io/
|
[stylelint]: https://stylelint.io/
|
||||||
|
[phpunit]: https://phpunit.de/
|
||||||
[phpdocumentor]: https://phpdoc.org/
|
[phpdocumentor]: https://phpdoc.org/
|
||||||
[footnotes-docs]: https://markcheret.github.io/footnotes/
|
[footnotes-docs]: https://markcheret.github.io/footnotes/
|
||||||
[gpl-v3]: https://www.gnu.org/licenses/gpl-3.0.en.html
|
[gpl-v3]: https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
"post-install-cmd": "npm install",
|
"post-install-cmd": "npm install",
|
||||||
"minify": "npm run minify",
|
"minify": "npm run minify",
|
||||||
"minify:css": "npm run minify:css",
|
"minify:css": "npm run minify:css",
|
||||||
"minify:js": "npm run minify:js"
|
"minify:js": "npm run minify:js",
|
||||||
|
"test": "phpunit"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
|
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
|
||||||
|
|
5770
package-lock.json
generated
5770
package-lock.json
generated
File diff suppressed because it is too large
Load diff
17
phpunit.xml
Normal file
17
phpunit.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit backupGlobals="false"
|
||||||
|
backupStaticAttributes="false"
|
||||||
|
bootstrap="./vendor/autoload.php"
|
||||||
|
colors="true"
|
||||||
|
convertErrorsToExceptions="true"
|
||||||
|
convertNoticesToExceptions="true"
|
||||||
|
convertWarningsToExceptions="true"
|
||||||
|
processIsolation="false"
|
||||||
|
stopOnFailure="false"
|
||||||
|
>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="Application Test Suite">
|
||||||
|
<directory>./tests/</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
</phpunit>
|
13
tests/exampleTest.php
Normal file
13
tests/exampleTest.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
final class ExampleTest extends TestCase {
|
||||||
|
public function testAdd() {
|
||||||
|
$result = 1 + 2;
|
||||||
|
|
||||||
|
$this->assertEquals(3, $result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Reference in a new issue