Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test using Travis CI #226

Merged
merged 19 commits into from Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 76 additions & 6 deletions .travis.yml
@@ -1,21 +1,91 @@
language: php

services:
- mysql

franzose marked this conversation as resolved.
Show resolved Hide resolved
php:
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
- LARAVEL_VERSION=5.4.*
- LARAVEL_VERSION=5.5.*
- LARAVEL_VERSION=5.6.*
franzose marked this conversation as resolved.
Show resolved Hide resolved
- LARAVEL_VERSION=5.7.*
- LARAVEL_VERSION=5.8.*
- LARAVEL_VERSION=6.*
- LARAVEL_VERSION=7.*

matrix:
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.*
- php: 5.6
env: LARAVEL_VERSION=5.6.*
- php: 7.0
env: LARAVEL_VERSION=5.6.*
- php: 7.4
env: LARAVEL_VERSION=5.6.*
- php: 5.6
env: LARAVEL_VERSION=5.7.*
- php: 7.0
env: LARAVEL_VERSION=5.7.*
- php: 7.4
env: LARAVEL_VERSION=5.7.*
franzose marked this conversation as resolved.
Show resolved Hide resolved
- php: 5.6
env: LARAVEL_VERSION=5.8.*
- php: 7.0
env: LARAVEL_VERSION=5.8.*
- php: 7.1
env: LARAVEL_VERSION=5.8.*
- php: 5.6
env: LARAVEL_VERSION=6.*
- php: 7.0
env: LARAVEL_VERSION=6.*
- php: 7.1
env: LARAVEL_VERSION=6.*
- php: 5.6
env: LARAVEL_VERSION=7.*
- php: 7.0
env: LARAVEL_VERSION=7.*
- php: 7.1
env: LARAVEL_VERSION=7.*
- php: 7.1
env: LARAVEL_VERSION=5.4.*
- php: 7.2
env: LARAVEL_VERSION=5.4.*
- php: 7.3
env: LARAVEL_VERSION=5.4.*
- php: 7.4
env: LARAVEL_VERSION=5.4.*

jobs:
fast_finish: true

sudo: false

install: travis_retry composer install --no-interaction --prefer-source
# ensure that the specific Laravel version is required
before_install:
- composer require "laravel/framework:${LARAVEL_VERSION}" --no-update

install: composer update --no-interaction --prefer-dist

before_script:
- mysql -e 'create database closuretabletest;'
- php ./tests/script-change-testcase-return-type.php

script: vendor/bin/phpunit
script:
- vendor/bin/phpunit

branches:
only:
- master
- feature/laravel-5
- 6.x
- travis-ci-for-6.x
# version tag, e.g. v1.0.0
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^\d+\.\d+?$/
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -15,8 +15,8 @@
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^6",
"orchestra/testbench": "^3.5"
"phpunit/phpunit": "^5.0|^6.0|^7.0|^8.0",
"orchestra/testbench": "^3.4|^4.0|^5.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="true"
>
<testsuites>
<testsuite name="Package Test Suite">
Expand Down
8 changes: 8 additions & 0 deletions tests/script-change-testcase-return-type.php
@@ -0,0 +1,8 @@
<?php

if(version_compare(phpversion(), '7.1', '<')){
exit(0);
}

file_put_contents('tests/BaseTestCase.php', str_replace('public function setUp()', 'public function setUp(): void', file_get_contents('tests/BaseTestCase.php')));
file_put_contents('tests/BaseTestCase.php', str_replace('public function tearDown()', 'public function tearDown(): void', file_get_contents('tests/BaseTestCase.php')));