@@ -78,7 +78,9 @@ code coverage of the fixed bugs and the new features.
78
78
79
79
To run the existing unit tests, run this command:
80
80
81
- vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/
81
+ ``` bash
82
+ vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/
83
+ ```
82
84
83
85
### Running the integration tests
84
86
@@ -90,12 +92,16 @@ schema once. Assuming that your database is named `phplist_test`, the user is
90
92
named ` phplist ` , and the password is ` batterystaple ` , the command looks like
91
93
this:
92
94
93
- mysql -u phplist_test --password=batterystaple phplist_test < vendor/phplist/phplist4-core/Database/Schema.sql
95
+ ``` bash
96
+ mysql -u phplist_test --password=batterystaple phplist_test < vendor/phplist/phplist4-core/Database/Schema.sql
97
+ ```
94
98
95
99
When running the integration tests, you will need to specify the database name
96
100
and access credentials on the command line (in the same line):
97
101
98
- PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
102
+ ``` bash
103
+ PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
104
+ ```
99
105
100
106
101
107
## Coding Style
@@ -109,18 +115,27 @@ We will only merge pull requests that follow the project's coding style.
109
115
110
116
Please check your code with the provided PHP_CodeSniffer standard:
111
117
112
- vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
118
+ ``` bash
119
+ vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
120
+ ```
113
121
114
122
Please also check the code structure using PHPMD:
115
123
116
- vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml
124
+ ``` bash
125
+ vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml
126
+ ```
117
127
118
128
And also please run the static code analysis:
119
129
120
- vendor/bin/phpstan analyse -l 5 Classes/ Tests/
130
+ ``` bash
131
+ vendor/bin/phpstan analyse -l 5 Classes/ Tests/
132
+ ```
121
133
122
134
You can also run all code style checks using one long line from a bash shell:
123
- find Classes/ Tests/ -name '* .php' -print0 | xargs -0 -n 1 -P 4 php -l && vendor/bin/phpstan analyse -l 5 Classes/ Tests/ && vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
135
+
136
+ ``` bash
137
+ find Classes/ Tests/ -name ' *.php' -print0 | xargs -0 -n 1 -P 4 php -l && vendor/bin/phpstan analyse -l 5 Classes/ Tests/ && vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
138
+ ```
124
139
125
140
This will execute all tests except for the unit tests and the integration
126
141
tests.
0 commit comments