Skip to content

Commit 1415342

Browse files
authored
Merge pull request #6 from alexz707/Travis-Fix
Fixing tests, added gitattributes
2 parents ce32f1b + c90ffd5 commit 1415342

5 files changed

Lines changed: 80 additions & 23 deletions

File tree

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.coveralls.yml export-ignore
2+
/.gitattributes export-ignore
3+
/.github/ export-ignore
4+
/.gitignore export-ignore
5+
/.travis.yml export-ignore
6+
/.scrutinizer.yml export-ignore
7+
/.php_cs export-ignore
8+
/phpcs.xml export-ignore
9+
/phpunit.xml.dist export-ignore
10+
/tests/ export-ignore

.travis.yml

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,65 @@
11
language: php
22

3-
php:
4-
- 7.3
5-
- 7.4
3+
cache:
4+
directories:
5+
- $HOME/.composer/cache
66

7-
before_script:
8-
- composer self-update
9-
- composer install --dev --prefer-source;
7+
env:
8+
global:
9+
- COMPOSER_ARGS="--no-interaction"
10+
11+
services:
12+
- mysql
13+
14+
matrix:
15+
fast_finish: true
16+
allow_failures:
17+
- php: nightly
18+
include:
19+
- php: 7.3
20+
env:
21+
- DEPS=lowest
22+
- php: 7.3
23+
env:
24+
- DEPS=latest
25+
- CS_CHECK=true
26+
- TEST_COVERAGE=true
27+
- php: 7.4
28+
env:
29+
- DEPS=lowest
30+
- php: 7.4
31+
env:
32+
- DEPS=latest
33+
- php: nightly
34+
env:
35+
- DEPS=lowest
36+
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
37+
- php: nightly
38+
env:
39+
- DEPS=latest
40+
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
41+
42+
before_install:
43+
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
44+
45+
install:
46+
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
47+
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
48+
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
49+
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
50+
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
51+
- stty cols 120 && composer show
1052
- wget https://scrutinizer-ci.com/ocular.phar
53+
54+
before_script:
1155
- mysql -e "create database IF NOT EXISTS lmc_user;" -uroot
1256

1357
script:
14-
- ./vendor/bin/phpunit --bootstrap=tests/bootstrap.php --configuration tests/phpunit.xml
58+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
1559
- ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./tests/
1660

17-
services:
18-
- mysql
19-
2061
after_script:
2162
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
2263

2364
notifications:
2465
email: "mail@matwright.dev"
25-
26-
27-
28-
matrix:
29-
fast_finish: true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LmcUser
22
=======
3-
[![Build Status](https://travis-ci.com/LM-Commons/LmcUser.svg?branch=master)](https://travis-ci.com/LM-Commons/LmcUser.svg?branch=master)
4-
[![Code Coverage](https://scrutinizer-ci.com/g/LM-Commons/LmcUser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LM-Commons/LmcUser/badges/quality-score.png?b=master)
3+
[![Build Status](https://travis-ci.com/LM-Commons/LmcUser.svg?branch=master)](https://travis-ci.com/LM-Commons/LmcUser)
4+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/LM-Commons/LmcUser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/LM-Commons/LmcUser/?branch=master)
55
[![Gitter](https://badges.gitter.im/LM-Commons/community.svg)](https://gitter.im/LM-Commons/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
66

77
Based on ZfcUser by Evan Coury and the ZF-Commons team

composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,15 @@
6767
"psr-0": {
6868
"LmcUserTest": "tests/"
6969
}
70+
},
71+
"scripts": {
72+
"check": [
73+
"@cs-check",
74+
"@test"
75+
],
76+
"cs-check": "phpcs",
77+
"cs-fix": "phpcbf",
78+
"test": "phpunit --colors=always",
79+
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
7080
}
7181
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<phpunit bootstrap="./bootstrap.php"
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="./vendor/autoload.php"
23
colors="true"
34
convertErrorsToExceptions="true"
45
convertNoticesToExceptions="true"
@@ -9,29 +10,29 @@
910
backupGlobals="false"
1011
>
1112
<testsuite name="LmcUser Test Suite">
12-
<directory>./LmcUserTest</directory>
13+
<directory>./tests/LmcUserTest</directory>
1314
</testsuite>
1415

1516
<php>
1617
<const name="DB_MYSQL_DSN" value="mysql:host=localhost;dbname=lmc_user" />
1718
<const name="DB_MYSQL_USERNAME" value="root" />
1819
<const name="DB_MYSQL_PASSWORD" value="" />
19-
<const name="DB_MYSQL_SCHEMA" value="../data/schema.mysql.sql" />
20+
<const name="DB_MYSQL_SCHEMA" value="./data/schema.mysql.sql" />
2021

2122
<const name="DB_SQLITE_DSN" value="sqlite::memory:" />
2223
<const name="DB_SQLITE_USERNAME" value="" />
2324
<const name="DB_SQLITE_PASSWORD" value="" />
24-
<const name="DB_SQLITE_SCHEMA" value="../data/schema.sqlite.sql" />
25+
<const name="DB_SQLITE_SCHEMA" value="./data/schema.sqlite.sql" />
2526
</php>
2627

2728
<filter>
2829
<whitelist>
29-
<directory suffix=".php">../src</directory>
30+
<directory suffix=".php">./src</directory>
3031
</whitelist>
3132
</filter>
3233

3334
<logging>
3435
<log type="coverage-text" target="php://stdout"/>
35-
<log type="coverage-clover" target="../build/logs/clover.xml"/>
36+
<log type="coverage-clover" target="./build/logs/clover.xml"/>
3637
</logging>
3738
</phpunit>

0 commit comments

Comments
 (0)