Skip to content

Commit

Permalink
Tests refactor, support for newer Laravel and PHP versions (#146)
Browse files Browse the repository at this point in the history
* Tests refactor, support for newer Laravel and PHP versions

* Update .travis.yml

* Update phpunit.xml

Co-authored-by: Pascal Baljet <[email protected]>
  • Loading branch information
pascalbaljet and pascalbaljet authored Mar 27, 2020
1 parent 3a0b7f6 commit 76026e0
Show file tree
Hide file tree
Showing 24 changed files with 318 additions and 10,707 deletions.
225 changes: 200 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,205 @@
cache:
directories:
- $HOME/.composer/cache

dist: trusty
language: php

php:
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
matrix:
include:
- php: 5.4
dist: trusty
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.4
dist: trusty
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.5
dist: trusty
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
dist: trusty
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.6
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='4.2.*' TESTBENCH='2.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

# Optimize the build since we are `composer installing` for each supported
# Laravel versions (see composer.json, under scripts sections).
cache:
directories:
- $HOME/.composer/cache
- php: 5.4
dist: trusty
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.4
dist: trusty
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.5
dist: trusty
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
dist: trusty
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.6
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='5.0.*' TESTBENCH='3.0.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

- php: 5.5
dist: trusty
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
dist: trusty
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.6
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.0
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.1
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.1.*' TESTBENCH='3.1.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

- php: 5.5
dist: trusty
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
dist: trusty
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 5.6
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.0
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.1
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.2.*' TESTBENCH='3.2.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

- php: 5.6
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.0
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.1
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.3.*' TESTBENCH='3.3.*' PHPUNIT='<6' COMPOSER_FLAGS='--prefer-stable'

- php: 5.6
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
- php: 7.0
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
- php: 7.1
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=5.7' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=6 <8' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.4.*' TESTBENCH='^3.4.2' PHPUNIT='>=6 <8' COMPOSER_FLAGS='--prefer-stable'

- php: 7.0
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
- php: 7.1
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='5.5.*' TESTBENCH='^3.5.5' PHPUNIT='>=6.5' COMPOSER_FLAGS='--prefer-stable'

- php: 7.1
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.6.*' TESTBENCH='3.6.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

- php: 7.1
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='5.7.*' TESTBENCH='3.7.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

- php: 7.1
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.4
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.4
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4
env: LARAVEL='6.*' TESTBENCH='4.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'

- php: 7.2
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
- php: 7.4
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4
env: LARAVEL='7.*' TESTBENCH='5.*' PHPUNIT='>=6' COMPOSER_FLAGS='--prefer-stable'
fast_finish: true

before_install:
- export COMPOSER_MEMORY_LIMIT=-1
- composer config discard-changes true
- travis_retry composer self-update
- travis_retry composer require "laravel/framework:${LARAVEL}" "phpunit/phpunit:${PHPUNIT}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update

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

before_script:
- composer self-update
# Installing `Laravel-JS-Localization` package dependencies. If the current
# PHP version is 5.5 then we should require minimum supported illuminate
# dependencies.
- if [[ `php -v` =~ "PHP 5.5" ]]; then composer require "illuminate/config:4.2.*" "illuminate/console:4.2.*" "illuminate/filesystem:4.2.*"; fi
- if [[ `php -v` =~ "PHP 7.2" || `php -v` =~ "PHP 7.3" ]]; then yes | pecl install mcrypt-1.0.2; fi
- composer install --prefer-dist --no-interaction
# Installing `Laravel-JS-Localization` package dependencies for each
# supported Laravel versions (see composer.json, under scripts section).
- composer test-install

script: composer test
script:
- vendor/bin/phpunit
101 changes: 51 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,65 @@
"name": "mariuzzo/laravel-js-localization",
"description": "Laravel Localization in JavaScript",
"type": "library",
"keywords": ["laravel", "laravel 5", "localization", "i18n", "javascript", "js", "lang"],
"keywords": [
"laravel",
"laravel 5",
"localization",
"i18n",
"javascript",
"js",
"lang"
],
"homepage": "https://github.com/rmariuzzo/laravel-js-localization",
"license": "MIT",
"authors": [{
"name": "Rubens Mariuzzo",
"email": "[email protected]",
"homepage": "https://github.com/rmariuzzo",
"role": "Developer"
}, {
"name": "German Popoter",
"email": "[email protected]",
"homepage": "https://github.com/gpopoteur",
"role": "Developer"
}, {
"name": "Galievskiy Dmitriy",
"homepage": "https://github.com/xAockd",
"role": "Developer"
}, {
"name": "Ramon Ackermann",
"homepage": "https://github.com/sboo",
"role": "Developer"
}, {
"name": "Anton Komarev",
"homepage": "https://github.com/antonkomarev",
"role": "Developer"
}],
"authors": [
{
"name": "Rubens Mariuzzo",
"email": "[email protected]",
"homepage": "https://github.com/rmariuzzo",
"role": "Developer"
},
{
"name": "German Popoter",
"email": "[email protected]",
"homepage": "https://github.com/gpopoteur",
"role": "Developer"
},
{
"name": "Galievskiy Dmitriy",
"homepage": "https://github.com/xAockd",
"role": "Developer"
},
{
"name": "Ramon Ackermann",
"homepage": "https://github.com/sboo",
"role": "Developer"
},
{
"name": "Anton Komarev",
"homepage": "https://github.com/antonkomarev",
"role": "Developer"
},
{
"name": "Pascal Baljet",
"homepage": "https://github.com/pascalbaljetmedia",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/rmariuzzo/laravel-js-localization/issues",
"source": "https://github.com/rmariuzzo/laravel-js-localization"
},
"require": {
"php": ">=5.4.0",
"illuminate/config": ">=4.2",
"illuminate/console": ">=4.2",
"illuminate/filesystem": ">=4.2",
"tedivm/jshrink": "~1.0",
"vlucas/phpdotenv": "^3.3"
"php": "^5.4 || ^7.0",
"illuminate/config": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"illuminate/console": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"illuminate/filesystem": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"tedivm/jshrink": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "4.8.*"
"orchestra/testbench": "^2.2 || ^3.0 || ^4.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"autoload": {
"psr-4": {
Expand All @@ -54,29 +73,11 @@
}
},
"minimum-stability": "stable",
"scripts": {
"test-install": [
"composer install --prefer-dist --no-interaction --working-dir tests/4.2",
"composer install --prefer-dist --no-interaction --working-dir tests/5.0",
"composer install --prefer-dist --no-interaction --working-dir tests/5.1",
"composer install --prefer-dist --no-interaction --working-dir tests/5.2",
"./tests/5.3/install",
"./tests/5.4/install"
],
"test": [
"./vendor/bin/phpunit --configuration tests/4.2",
"./vendor/bin/phpunit --configuration tests/5.0",
"./vendor/bin/phpunit --configuration tests/5.1",
"./vendor/bin/phpunit --configuration tests/5.2",
"./tests/5.3/run",
"./tests/5.4/run"
]
},
"extra": {
"laravel": {
"providers": [
"Mariuzzo\\LaravelJsLocalization\\LaravelJsLocalizationServiceProvider"
]
}
}
}
}
6 changes: 3 additions & 3 deletions tests/5.0/phpunit.xml → phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
verbose="true">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">../specs/</directory>
<directory suffix="Test.php">./tests/specs</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
11 changes: 0 additions & 11 deletions tests/4.2/composer.json

This file was deleted.

Loading

0 comments on commit 76026e0

Please sign in to comment.