Skip to content

Commit

Permalink
Bugfix/codestyle (#115)
Browse files Browse the repository at this point in the history
* Fixing Codestyle
* added new script 'test' to run all Tests, extends the README.md with steps to contributing
  • Loading branch information
vansari authored Nov 13, 2022
1 parent 987a956 commit 7fb0845
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,32 @@ Load Codeception config file to specify the path to Codeception before split* ta
\Codeception\Configuration::config('tests/codeception.yml');
```

## Contributing

Thank you for contributing to codeception/robo-paracept!

1. Fork this project
2. install all deps
3. create a branch from master
4. make your changes
5. extend or create tests for your changes
6. run `composer test` (This will execute lint, codestyle and unit tests sequential)
7. open a Merge Request

### Coding Standard

Please note that this project follows the PSR-12 Coding Standard. You can check your coding style with:

```shell
composer codestyle
```

### Unit Tests

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.

```shell
composer unit
```

### License MIT
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
"scripts": {
"unit": "vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/ --exclude-group example --stderr -v --debug",
"lint": "vendor/bin/phplint -v ./ --exclude=vendor",
"codestyle": "vendor/bin/phpcs --standard=PSR12 ./src"
"codestyle": "vendor/bin/phpcs --standard=PSR12 ./src",
"test": [
"@lint",
"@codestyle",
"@unit"
]
}
}
11 changes: 6 additions & 5 deletions src/Filter/GroupFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ public function filter(): array
$groups = $groupManager->groupsForTest($test);

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

if (
Expand Down

0 comments on commit 7fb0845

Please sign in to comment.