Skip to content

Commit

Permalink
Test each supported Laravel version
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed May 25, 2017
1 parent 55a659e commit 79c8f69
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 41 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/extras/
/vendor/
vendor/
.php_cs.cache
composer.lock
composer.phar
Expand Down
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ env:
global:
- setup=basic

# Optimize the build since we are `composer installing` for each supported
# Laravel versions (see composer.json, under scripts sections).
cache:
directories:
- $HOME/.composer/cache

before_script:
- composer config discard-changes true
- if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction; fi
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
# Installing `Laravel-YouTrack-SDK` package dependencies for each
# supported Laravel versions (see composer.json, under scripts section).
- composer test-install

script:
- ./vendor/bin/phpunit -c phpunit.xml.dist --verbose
- composer test
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.11",
"mockery/mockery": "^0.9.8",
"orchestra/database": "~3.4.0",
"orchestra/testbench": "~3.4.0",
"phpunit/phpunit": "^5.7"
},
"autoload": {
Expand All @@ -59,7 +56,18 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit"
"test-install": [
"composer install --prefer-dist --no-interaction --working-dir tests/framework/5.1",
"composer install --prefer-dist --no-interaction --working-dir tests/framework/5.2",
"composer install --prefer-dist --no-interaction --working-dir tests/framework/5.3",
"composer install --prefer-dist --no-interaction --working-dir tests/framework/5.4"
],
"test": [
"./vendor/bin/phpunit --configuration tests/framework/5.1",
"./vendor/bin/phpunit --configuration tests/framework/5.2",
"./vendor/bin/phpunit --configuration tests/framework/5.3",
"./vendor/bin/phpunit --configuration tests/framework/5.4"
]
},
"config": {
"sort-packages": true
Expand Down
34 changes: 0 additions & 34 deletions phpunit.xml.dist

This file was deleted.

8 changes: 8 additions & 0 deletions tests/framework/5.1/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"illuminate/support": "~5.1.20"
},
"require-dev": {
"orchestra/testbench": "3.1.*"
}
}
31 changes: 31 additions & 0 deletions tests/framework/5.1/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">../../Unit/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="YOUTRACK_BASE_URI" value="https://youtrack.example.com"/>
<env name="YOUTRACK_AUTH" value="token"/>
<env name="YOUTRACK_TOKEN" value=""/>
<env name="YOUTRACK_USERNAME" value=""/>
<env name="YOUTRACK_PASSWORD" value=""/>
<env name="YOUTRACK_PROJECT" value="TEST"/>
</php>
</phpunit>
8 changes: 8 additions & 0 deletions tests/framework/5.2/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"illuminate/support": "~5.2.0"
},
"require-dev": {
"orchestra/testbench": "3.2.*"
}
}
31 changes: 31 additions & 0 deletions tests/framework/5.2/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">../../Unit/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="YOUTRACK_BASE_URI" value="https://youtrack.example.com"/>
<env name="YOUTRACK_AUTH" value="token"/>
<env name="YOUTRACK_TOKEN" value=""/>
<env name="YOUTRACK_USERNAME" value=""/>
<env name="YOUTRACK_PASSWORD" value=""/>
<env name="YOUTRACK_PROJECT" value="TEST"/>
</php>
</phpunit>
8 changes: 8 additions & 0 deletions tests/framework/5.3/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"illuminate/support": "~5.3.0"
},
"require-dev": {
"orchestra/testbench": "3.3.*"
}
}
31 changes: 31 additions & 0 deletions tests/framework/5.3/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">../../Unit/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="YOUTRACK_BASE_URI" value="https://youtrack.example.com"/>
<env name="YOUTRACK_AUTH" value="token"/>
<env name="YOUTRACK_TOKEN" value=""/>
<env name="YOUTRACK_USERNAME" value=""/>
<env name="YOUTRACK_PASSWORD" value=""/>
<env name="YOUTRACK_PROJECT" value="TEST"/>
</php>
</phpunit>
8 changes: 8 additions & 0 deletions tests/framework/5.4/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"illuminate/support": "~5.4.0"
},
"require-dev": {
"orchestra/testbench": "3.4.*"
}
}
31 changes: 31 additions & 0 deletions tests/framework/5.4/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">../../Unit/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<php>
<env name="YOUTRACK_BASE_URI" value="https://youtrack.example.com"/>
<env name="YOUTRACK_AUTH" value="token"/>
<env name="YOUTRACK_TOKEN" value=""/>
<env name="YOUTRACK_USERNAME" value=""/>
<env name="YOUTRACK_PASSWORD" value=""/>
<env name="YOUTRACK_PROJECT" value="TEST"/>
</php>
</phpunit>

0 comments on commit 79c8f69

Please sign in to comment.