Skip to content

Commit 0de0fe6

Browse files
committed
Bugfix/codestyle (#115)
* Fixing Codestyle * added new script 'test' to run all Tests, extends the README.md with steps to contributing
1 parent 80a83cb commit 0de0fe6

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,32 @@ Load Codeception config file to specify the path to Codeception before split* ta
216216
\Codeception\Configuration::config('tests/codeception.yml');
217217
```
218218

219+
## Contributing
220+
221+
Thank you for contributing to codeception/robo-paracept!
222+
223+
1. Fork this project
224+
2. install all deps
225+
3. create a branch from master
226+
4. make your changes
227+
5. extend or create tests for your changes
228+
6. run `composer test` (This will execute lint, codestyle and unit tests sequential)
229+
7. open a Merge Request
230+
231+
### Coding Standard
232+
233+
Please note that this project follows the PSR-12 Coding Standard. You can check your coding style with:
234+
235+
```shell
236+
composer codestyle
237+
```
238+
239+
### Unit Tests
240+
241+
All changes which you will done must pass the unit tests. If you change some logic or you add some new methods please be fair and write a test.
242+
243+
```shell
244+
composer unit
245+
```
246+
219247
### License MIT

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
"scripts": {
3939
"unit": "vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ --exclude-group example --stderr -v --debug",
4040
"lint": "vendor/bin/phplint -v ./ --exclude=vendor",
41-
"codestyle": "vendor/bin/phpcs --standard=PSR12 ./src"
41+
"codestyle": "vendor/bin/phpcs --standard=PSR12 ./src",
42+
"test": [
43+
"@lint",
44+
"@codestyle",
45+
"@unit"
46+
]
4247
}
4348
}

src/Filter/GroupFilter.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ public function filter(): array
137137
$groups = $groupManager->groupsForTest($test);
138138

139139
if (!$groups && $test instanceof \PHPUnit\Framework\DataProviderTestSuite) {
140-
/** @var \PHPUnit\Framework\DataProviderTestSuite $dataProviderTestSuite */
141-
$dataProviderTestSuite = $test;
142-
// By definition (a) all tests of dataprovider test suite are the same test case definition, and (b) there is at least one test case
143-
$firstDataProviderTest = $dataProviderTestSuite->tests()[0];
144-
$groups = $groupManager->groupsForTest($firstDataProviderTest);
140+
/** @var \PHPUnit\Framework\DataProviderTestSuite $dataProviderTestSuite */
141+
$dataProviderTestSuite = $test;
142+
// By definition (a) all tests of dataprovider test suite are the same test
143+
// case definition, and (b) there is at least one test case
144+
$firstDataProviderTest = $dataProviderTestSuite->tests()[0];
145+
$groups = $groupManager->groupsForTest($firstDataProviderTest);
145146
}
146147

147148
if (

0 commit comments

Comments
 (0)