Skip to content

Commit

Permalink
Initial setup for PHPUnit tests, Travis CI, Scrutinizer CI, Style CI …
Browse files Browse the repository at this point in the history
…and PHPStan
  • Loading branch information
antonioribeiro authored and ifox committed Nov 18, 2019
1 parent c36ed85 commit c287dc1
Show file tree
Hide file tree
Showing 10 changed files with 1,648 additions and 330 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ assets/dist/*
frontend/js/components/blocks/customs/*
.DS_Store
public/
tests/coverage
25 changes: 25 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
checks:
php:
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true

filter:
paths: [src/*]
excluded_paths: ["tests/*"]

coding_style:
php: { }

tools:
external_code_coverage: true
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
dist: trusty
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
# - nightly

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

## Cache composer
cache:
directories:
- $HOME/.composer/cache

before_script:
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist

script:
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- |
if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
fi
21 changes: 15 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
],
"require": {
"php": "^7.0",
"php": "^7.1",
"ext-json": "*",
"ext-pdo": "*",
"laravel/framework": "~5.6.0|~5.7.0|~5.8.0|^6.3",
Expand All @@ -68,11 +68,16 @@
"matthewbdaly/laravel-azure-storage": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "~5.0|~6.0|~7.0"
"phpunit/phpunit": "~5.0|~6.0|~7.0|~8.0",
"orchestra/testbench": "~3.3.0|~3.4.0|~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0",
"phpstan/phpstan": "^0.11.16"
},
"autoload": {
"psr-4": {
"A17\\Twill\\": "src/"
"A17\\Twill\\": "src/",
"A17\\Twill\\Tests\\Unit\\": "tests/unit",
"A17\\Twill\\Tests\\Integration\\": "tests/integration",
"App\\": "vendor/orchestra/testbench-core/laravel/app"
},
"files": [
"src/Helpers/routes_helpers.php",
Expand All @@ -83,11 +88,15 @@
"src/Helpers/helpers.php"
]
},
"scripts": {
"test": "vendor/bin/phpunit --colors=always",
"analyse": "php -d memory_limit=-1 vendor/bin/phpstan analyse src tests"
},
"extra": {
"laravel": {
"providers": [
"A17\\Twill\\TwillServiceProvider"
]
"providers": [
"A17\\Twill\\TwillServiceProvider"
]
}
},
"minimum-stability": "stable",
Expand Down
Loading

0 comments on commit c287dc1

Please sign in to comment.