Skip to content

Commit 6b3e837

Browse files
mabarf3l1x
authored andcommitted
Sync with Contributte standards
1 parent 04067e1 commit 6b3e837

File tree

9 files changed

+102
-90
lines changed

9 files changed

+102
-90
lines changed

.docs/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ This library is here to help you with Integration and [Functional Tests](http://
44

55
## Content
66

7-
- [Usage - How to use it](#usage)
7+
- [Setup](#setup)
8+
- [Usage](#usage)
89
- [DI module - Nette\DI integration](#nettedimodule)
910
- [Application module - Nette\Application integration](#netteapplicationmodule)
1011
- [Development](#development)
1112

13+
## Setup
14+
15+
```bash
16+
composer require contributte/codeception
17+
```
18+
1219
## Usage
1320

1421
### NetteDIModule
@@ -35,7 +42,7 @@ modules:
3542
# newContainerForEachTest: true
3643
```
3744

38-
```
45+
```yml
3946
# /tests/integration/config/config.neon
4047
services:
4148
- MyService
@@ -103,7 +110,7 @@ class HomepageTest extends Unit
103110

104111
## Development
105112

106-
Simply run scripts in `composer.json` and make sure that qa, tester and phpstan passed.
113+
Simply run scripts in `Makefile` and make sure that qa, tester and phpstan passed.
107114

108115
### Advanced usage
109116

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tests export-ignore
66
.gitignore export-ignore
77
.travis.yml export-ignore
88
codeception.yml export-ignore
9+
Makefile export-ignore
910
phpstan.neon export-ignore
1011
README.md export-ignore
1112
ruleset.xml export-ignore

.travis.yml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,54 @@
11
language: php
2+
23
php:
34
- 7.1
45
- 7.2
56
- 7.3
7+
- 7.4snapshot
8+
- nightly
69

710
before_install:
8-
# Turn off XDebug
9-
- phpenv config-rm xdebug.ini || return 0
11+
- phpenv config-rm xdebug.ini || return 0 # Turn off XDebug
1012

1113
install:
12-
# Composer
1314
- travis_retry composer install --no-progress --prefer-dist
1415

1516
script:
16-
# Tests
17-
- composer run-script tests
18-
17+
- make tests
1918

2019
jobs:
2120
include:
22-
- env: title="Lowest Dependencies 7.1"
21+
- env: title="Lowest Dependencies"
2322
php: 7.1
2423
install:
25-
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
24+
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
2625
script:
27-
- composer run-script tests
26+
- make tests
2827

2928
- stage: Quality Assurance
30-
php: 7.1
31-
script:
32-
- composer run-script qa
33-
34-
- stage: Phpstan
35-
php: 7.1
29+
php: 7.3
3630
script:
37-
- composer run-script phpstan-install
38-
- composer run-script phpstan
31+
- make qa
3932

4033
- stage: Test Coverage
4134
if: branch = master AND type = push
42-
php: 7.1
35+
php: 7.3
4336
script:
44-
- composer run-script coverage
37+
- make coverage
4538
after_script:
46-
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
47-
- php php-coveralls.phar --verbose --config tests/.coveralls.yml
39+
- composer global require php-coveralls/php-coveralls ^2.1.0
40+
- ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml
4841

4942
- stage: Outdated Dependencies
5043
if: branch = master AND type = cron
51-
php: 7.1
44+
php: 7.3
5245
script:
53-
- composer outdated --direct --strict
46+
- composer outdated --direct
5447

5548
allow_failures:
5649
- stage: Test Coverage
50+
- php: 7.4snapshot
51+
- php: nightly
5752

5853
sudo: false
5954

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Contributte
4+
Copyright (c) 2016 Jáchym Toušek (enumag@gmail.com)
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

LICENSE.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.PHONY: qa lint cs csf phpstan tests coverage
2+
3+
all:
4+
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"}'
5+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
6+
7+
# QA
8+
9+
qa: lint phpstan cs ## Check code quality - coding style and static analysis
10+
11+
lint: ## Check PHP files syntax
12+
vendor/bin/linter src tests
13+
14+
cs: ## Check PHP files coding style
15+
vendor/bin/codesniffer src tests
16+
17+
csf: ## Fix PHP files coding style
18+
vendor/bin/codefixer src tests
19+
20+
phpstan: ## Analyse code with PHPStan
21+
vendor/bin/phpstan analyse -l max -c phpstan.neon src
22+
23+
# Tests
24+
25+
tests: ## Run all tests
26+
vendor/bin/codecept build
27+
vendor/bin/codecept run --debug
28+
29+
coverage: ## Generate code coverage in XML format
30+
phpdbg -qrr vendor/bin/phpunit tests --colors=always -c tests/coverage.xml

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
Integration of Nette Framework to Codeception.
44

5-
-----
6-
75
[![Build Status](https://img.shields.io/travis/contributte/codeception.svg?style=flat-square)](https://travis-ci.org/contributte/codeception)
86
[![Code coverage](https://img.shields.io/coveralls/contributte/codeception.svg?style=flat-square)](https://coveralls.io/r/contributte/codeception)
97
[![Licence](https://img.shields.io/packagist/l/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
108
[![Downloads this Month](https://img.shields.io/packagist/dm/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
119
[![Downloads total](https://img.shields.io/packagist/dt/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
1210
[![Latest stable](https://img.shields.io/packagist/v/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
13-
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
11+
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)
1412

1513
## Discussion / Help
1614

1715
[![Join the chat](https://img.shields.io/gitter/room/contributte/contributte.svg?style=flat-square)](http://bit.ly/ctteg)
1816

19-
## Install
17+
## Documentation
2018

21-
```
22-
composer require contributte/codeception
23-
```
19+
- [Setup](.docs/README.md#setup)
20+
- [Usage](.docs/README.md#usage)
21+
- [DI module - Nette\DI integration](.docs/README.md#nettedimodule)
22+
- [Application module - Nette\Application integration](.docs/README.md#netteapplicationmodule)
23+
- [Development](.docs/README.md#development)
2424

2525
## Versions
2626

@@ -30,12 +30,6 @@ composer require contributte/codeception
3030
| stable | `^1.0.0` | `master` | `>= 7.1` | |
3131
| stable | `^0.8.1` | `master` | `>= 7.1` | (old namespace) |
3232

33-
## Overview
34-
35-
- [Usage - How to use it](/.docs/README.md#usage)
36-
- [DI module - Nette\DI integration](/.docs/README.md#nettedimodule)
37-
- [Application module - Nette\Application integration](/.docs/README.md#netteapplicationmodule)
38-
- [Development](/.docs/README.md#development)
3933

4034
## Maintainers
4135

@@ -60,6 +54,4 @@ composer require contributte/codeception
6054
</tbody>
6155
</table>
6256

63-
-----
64-
6557
Thank you for testing, reporting and contributing.

composer.json

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@
2727
"nette/utils": "^3.0"
2828
},
2929
"require-dev": {
30-
"ninjify/qa": "^0.8.0",
30+
"latte/latte": "~2.5.1",
3131
"nette/application": "^3.0",
3232
"nette/caching": "~2.5.8 || ^3.0",
33-
"latte/latte": "~2.5.1",
33+
"ninjify/qa": "^0.8.0",
34+
"phpstan/extension-installer": "^1.0",
35+
"phpstan/phpstan-deprecation-rules": "^0.11",
36+
"phpstan/phpstan-nette": "^0.11",
37+
"phpstan/phpstan-shim": "^0.11",
38+
"phpstan/phpstan-strict-rules": "^0.11",
3439
"tracy/tracy": "~2.6.1"
3540
},
3641
"conflict": {
3742
"symfony/browser-kit": "<4.0.0"
3843
},
39-
"minimum-stability": "dev",
40-
"prefer-stable": true,
4144
"autoload": {
4245
"psr-4": {
4346
"Contributte\\Codeception\\": "src"
@@ -51,29 +54,10 @@
5154
"vendor/codeception/codeception/shim.php"
5255
]
5356
},
54-
"scripts": {
55-
"qa": [
56-
"linter src tests",
57-
"codesniffer src tests"
58-
],
59-
"tests": [
60-
"vendor/bin/codecept build",
61-
"vendor/bin/codecept run --debug"
62-
],
63-
"coverage": [
64-
"phpdbg -qrr vendor/bin/phpunit tests --colors=always -c tests/coverage.xml"
65-
],
66-
"phpstan-install": [
67-
"mkdir -p temp/phpstan",
68-
"composer require -d temp/phpstan nette/utils:^3.0",
69-
"composer require -d temp/phpstan phpstan/phpstan:^0.10",
70-
"composer require -d temp/phpstan phpstan/phpstan-deprecation-rules:^0.10",
71-
"composer require -d temp/phpstan phpstan/phpstan-nette:^0.10",
72-
"composer require -d temp/phpstan phpstan/phpstan-strict-rules:^0.10"
73-
],
74-
"phpstan": [
75-
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
76-
]
57+
"minimum-stability": "dev",
58+
"prefer-stable": true,
59+
"config": {
60+
"sort-packages": true
7761
},
7862
"extra": {
7963
"branch-alias": {

phpstan.neon

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
includes:
2-
- temp/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
3-
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon
4-
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon
5-
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
6-
7-
services:
8-
-
9-
class: Contributte\Codeception\Qa\PhpStan\NetteDIModuleType
10-
tags:
11-
- phpstan.broker.dynamicMethodReturnTypeExtension
2+
- extension.neon
123

134
parameters:
145
excludes_analyse:
156
- %rootDir%/../../../tests/_*
167

178
ignoreErrors:
189
- '#^Only booleans are allowed in a negated boolean, string\|null given.#'
10+
- '#(.+)should be contravariant(.+)#'
1911

2012
# Should not happen
2113
- '#^Method Contributte\\Codeception\\Module\\NetteDIModule::getContainer\(\) should return Nette\\DI\\Container but returns Nette\\DI\\Container\|null#'
@@ -29,4 +21,4 @@ parameters:
2921
- '#^Call to an undefined method PHPStan\\#'
3022

3123
# Symfony 4.3 deprecation message
32-
- '#^Class Contributte\\Codeception\\Connector\\NetteConnector extends deprecated class Symfony\\Component\\BrowserKit\\Client\.#'
24+
- '#^Class Contributte\\Codeception\\Connector\\NetteConnector extends deprecated class Symfony\\Component\\BrowserKit\\Client(.+)#'

0 commit comments

Comments
 (0)