Skip to content

Commit ce436b3

Browse files
committed
Merge pull request #480 from lucadegasperi/tests
Make tests turn green
2 parents 1b10f3c + 8c1b0d0 commit ce436b3

File tree

6 files changed

+43
-105
lines changed

6 files changed

+43
-105
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/vendor
2-
composer.phar
3-
.DS_Store
4-
/.idea/
51
composer.lock
2+
phpunit.xml
3+
phpspec.yml
4+
vendor

.travis.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
language: php
22

33
php:
4-
- 5.5
54
- 5.5.9
5+
- 5.5
66
- 5.6
7+
- 7.0
78
- hhvm
89

910
matrix:
11+
fast_finish: true
1012
allow_failures:
11-
- php: hhvm
13+
- php: 7.0
1214

13-
before_script:
14-
- curl -s http://getcomposer.org/installer | php
15-
- php composer.phar install --dev --no-interaction
16-
- wget https://scrutinizer-ci.com/ocular.phar
17-
- wget https://phar.phpunit.de/phpcov.phar
15+
sudo: false
16+
17+
install:
18+
- travis_retry composer install --no-interaction --prefer-source
19+
1820
script:
19-
- mkdir -p tmp
20-
- vendor/bin/phpspec run -c phpspec.yml.dist
21-
- vendor/bin/phpunit --configuration phpunit.xml.dist
22-
after_script:
23-
- php phpcov.phar merge --clover tmp/coverage.clover tmp
24-
- php ocular.phar code-coverage:upload --format=php-clover tmp/coverage.clover
21+
- if [ "$TRAVIS_PHP_VERSION" != "5.5.9" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; vendor/bin/phpspec run; fi
22+
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi
2523

26-
cache:
27-
directories:
28-
- vendor
24+
after_script:
25+
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
26+
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi

phpspec.yml

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

phpspec.yml.dist

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,5 @@ suites:
22
package_suite:
33
namespace: LucaDegasperi\OAuth2Server
44
src_path: src
5-
spec_path: tests
65
spec_prefix: unit
7-
extensions:
8-
- PhpSpec\Extension\CodeCoverageExtension
9-
code_coverage:
10-
whitelist:
11-
- src
12-
blacklist_files:
13-
- src/OAuth2ServerServiceProvider.php
14-
- src/Facades/AuthorizerFacade.php
15-
output: tmp/unit-coverage.cov
16-
format: php
6+
spec_path: tests

phpunit.xml

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

phpunit.xml.dist

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit colors="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" bootstrap="vendor/autoload.php">
3-
<testsuites>
4-
<testsuite name="Package Test Suite">
5-
<directory suffix=".php">./tests/integration</directory>
6-
</testsuite>
7-
</testsuites>
8-
<filter>
9-
<whitelist>
10-
<directory>./src</directory>
11-
<exclude>
12-
<directory>./build</directory>
13-
<directory>./src/migrations</directory>
14-
<directory>./src/config</directory>
15-
<directory>./src/lang</directory>
16-
<directory>./src/views</directory>
17-
<directory>./composer</directory>
18-
<directory>./tests</directory>
19-
<directory>./travis</directory>
20-
<directory>./vendor</directory>
21-
<directory>./stubs</directory>
22-
<directory>./seeds</directory>
23-
<file>./src/OAuth2ServerServiceProvider.php</file>
24-
<file>./src/Repositories/FluentAdapter.php</file>
25-
</exclude>
26-
</whitelist>
27-
</filter>
28-
<logging>
29-
<log type="coverage-php" target="tmp/integration-coverage.cov"/>
30-
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
31-
</logging>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
beStrictAboutTestsThatDoNotTestAnything="true"
5+
beStrictAboutOutputDuringTests="true"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
processIsolation="false"
12+
stopOnError="false"
13+
stopOnFailure="false"
14+
verbose="true"
15+
>
16+
<testsuites>
17+
<testsuite name="OAuth 2.0 Laravel Test Suite">
18+
<directory suffix="Test.php">./tests</directory>
19+
</testsuite>
20+
</testsuites>
21+
<filter>
22+
<whitelist processUncoveredFilesFromWhitelist="true">
23+
<directory suffix=".php">./src</directory>
24+
</whitelist>
25+
</filter>
3226
</phpunit>
27+

0 commit comments

Comments
 (0)