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 13 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
66 changes: 61 additions & 5 deletions .travis.yml
@@ -1,14 +1,66 @@
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: 5.6
env: LARAVEL_VERSION=5.7.*
- php: 7.0
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.*

jobs:
fast_finish: true

sudo: false

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

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

before_script:
- mysql -e 'create database closuretabletest;'
Expand All @@ -18,4 +70,8 @@ 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": "^6.0|^7.0|^8.0",
avvertix marked this conversation as resolved.
Show resolved Hide resolved
avvertix marked this conversation as resolved.
Show resolved Hide resolved
"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
4 changes: 2 additions & 2 deletions tests/BaseTestCase.php
Expand Up @@ -15,7 +15,7 @@ abstract class BaseTestCase extends TestCase
{
const DATABASE_CONNECTION = 'closuretable';

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand All @@ -32,7 +32,7 @@ public function setUp()
]);
}

public function tearDown()
public function tearDown(): void
{
// this is to avoid "too many connection" errors
DB::disconnect(static::DATABASE_CONNECTION);
Expand Down