coding style
[dokuwiki.git] / _test / README
blob4cf5646b1b60b85659871a1634c2313dc44b2671
1 ====== DokuWiki Test Suite and Develpoment Tools ======
3 This directory contains the test suite for DokuWiki as well as configuration for various code quality tools.
5 ===== Setup =====
7 Before you can use any of the tools you need to install the dependencies. This is done using composer.
9   composer install
11 If you don't have composer installed yet, you can get it from https://getcomposer.org/
13 ===== Composer Scripts =====
15 The composer configuration contains a number of scripts to run the various tools on all of DokuWiki.
17 Run all the tests:
19   composer run test
21 Check for code style violations:
23   composer run check
25 Automatically fix code style violations:
27   composer run autofix
29 ===== Tools =====
31 All the tools can be called directly from the ''vendor/bin'' directory.
33 ==== PHPUnit ====
35   ./vendor/bin/phpunit --verbose --stderr
37 The --stderr flag is needed to avoid a headers already sent error on some systems.
39 To learn more about running tests and writing your own, visit https://www.dokuwiki.org/devel:unittesting
41 ==== PHP CodeSniffer ====
43 To check for code violations:
45   ./vendor/bin/phpcs
47 To automatically fix code violations:
49   ./vendor/bin/phpcbf
51 To learn more about PHP CodeSniffer visit https://www.dokuwiki.org/devel:phpcodesniffer
53 ==== Rector ====
55 To automatically fix code smells
57   ./vendor/bin/rector process
59 To learn more about PHP CodeSniffer visit https://www.dokuwiki.org/devel:rector