Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit bf455b9

Browse files
committed
Updated phpunit
1 parent 6e0879d commit bf455b9

File tree

5 files changed

+2129
-45
lines changed

5 files changed

+2129
-45
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
composer.phar
2-
/vendor/
2+
/vendor/
3+
/build

.travis.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,67 @@
1-
# Travis CI (MIT License) configuration file
2-
# @link https://travis-ci.org/
1+
# Travis CI
32

43
# Use new container based environment
54
sudo: false
65

76
# Declare project language.
8-
# @link http://about.travis-ci.org/docs/user/languages/php/
97
language: php
108

11-
# Declare versions of PHP to use. Use one decimal max.
12-
# @link http://docs.travis-ci.com/user/build-configuration/
9+
env:
10+
global:
11+
# Name and folder of the the standard to test.
12+
- STANDARD="CodeIgniter4"
13+
# Upload covarage to coveralls.
14+
- COVERALLS="1"
15+
1316
matrix:
1417
fast_finish: true
1518

19+
# Declare versions of PHP to use. Use one decimal max.
1620
include:
1721
# aliased to a recent 5.4.x version
1822
# - php: '5.4'
1923
# aliased to a recent 5.5.x version
2024
# - php: '5.5'
2125
# aliased to a recent 5.6.x version
2226
# - php: '5.6'
23-
# env: SNIFF=1
2427
# aliased to a recent 7.x version
2528
# - php: '7.0'
2629
# aliased to a recent 7.x version
2730
- php: '7.1'
28-
env: SNIFF=1
2931
# aliased to a recent hhvm version
30-
- php: 'hhvm'
32+
# - php: 'hhvm'
3133
# php nightly
32-
- php: 'nightly'
34+
# - php: 'nightly'
3335

34-
allow_failures:
35-
- php: 'hhvm'
36-
- php: nightly
36+
# allow_failures:
37+
# - php: 'hhvm'
38+
# - php: 'nightly'
3739

3840
before_install:
39-
# Install CodeIgniter4-Standard deps.
40-
- if [[ "$SNIFF" == "1" ]]; then composer self-update; fi
41-
- if [[ "$SNIFF" == "1" ]]; then composer require squizlabs/php_codesniffer:dev-master; fi
42-
- if [[ "$SNIFF" == "1" ]]; then composer require satooshi/php-coveralls:dev-master; fi
43-
- if [[ "$SNIFF" == "1" ]]; then composer install; fi
44-
- phpenv rehash
41+
# Remove xdebug. Needed for coverage.
42+
# - phpenv config-rm xdebug.ini
43+
44+
install:
45+
# Update composer to latest version.
46+
- composer self-update
47+
# Install project composer deps in composer.json
48+
- composer install --no-interaction
49+
50+
before_script:
51+
# Rehash the php environment if testing on several PHP versions.
52+
# - phpenv rehash
4553

4654
script:
47-
# Search for PHP syntax errors.
48-
- if [[ "$SNIFF" == "1" ]]; then find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
49-
# Change dir.
50-
- if [[ "$SNIFF" == "1" ]]; then cd ./vendor/squizlabs/php_codesniffer/; fi
51-
# Install php_codesniffer deps.
52-
- if [[ "$SNIFF" == "1" ]]; then composer install; fi
55+
# Check for PHP syntax errors.
56+
- find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
5357
# - Check files match the PHPCS standard.
54-
- if [[ "$SNIFF" == "1" ]]; then ./bin/phpcs --ignore=*/Tests/* ../../../CodeIgniter4; fi
55-
# - Change the default standard.
56-
- if [[ "$SNIFF" == "1" ]]; then ./bin/phpcs --config-set installed_paths ../../../CodeIgniter4; fi
57-
# - Verify it's installed.
58-
- if [[ "$SNIFF" == "1" ]]; then ./bin/phpcs -i; fi
59-
# - Run unit tests for CodeIgniter4 standard.
60-
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpunit --debug --coverage-clover=../../../build/logs/clover.xml --filter CodeIgniter4 ./tests/AllTests.php; fi
58+
- ./vendor/bin/phpcs --ignore=*/Tests/* ./$STANDARD/ --standard=./vendor/squizlabs/php_codesniffer/phpcs.xml.dist
59+
# Change the default standard.
60+
- ./vendor/bin/phpcs --config-set installed_paths $TRAVIS_BUILD_DIR/$STANDARD
61+
# Verify it's installed.
62+
- ./vendor/bin/phpcs -i
63+
# Run unit tests for the standard.
64+
- ./vendor/bin/phpunit --debug --filter $STANDARD
6165

6266
after_success:
63-
- if [[ "$SNIFF" == "1" ]]; then cd ../../../; fi
64-
- if [[ "$SNIFF" == "1" ]]; then php ./vendor/bin/coveralls -v -x ./build/logs/clover.xml; fi
67+
- if [[ "$COVERALLS" == "1" ]]; then ./vendor/bin/coveralls -v -x ./build/logs/coverage/clover/clover.xml; fi

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"require": {
1515
},
1616
"require-dev": {
17-
"squizlabs/php_codesniffer": "dev-master"
17+
"squizlabs/php_codesniffer": "^3.1",
18+
"satooshi/php-coveralls": "^1.0",
19+
"phpunit/phpunit": "^6.5"
1820
}
1921
}

0 commit comments

Comments
 (0)