Skip to content

Commit

Permalink
Refactor continuous integration
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Feb 18, 2019
1 parent e05dc5c commit ac44d4a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 162 deletions.
101 changes: 0 additions & 101 deletions .php_cs

This file was deleted.

2 changes: 2 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tools:
external_code_coverage: true
16 changes: 0 additions & 16 deletions .styleci.yml

This file was deleted.

37 changes: 28 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
language: php

php:
- 5.6
- 7.0
- hhvm
env:
global:
- COVERAGE=no
- RELEASE=stable

matrix:
allow_failures:
- php: 7.0
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
env: COVERAGE=yes

sudo: false
cache:
directories:
- $HOME/.composer/cache

install: travis_retry composer install --no-interaction --prefer-source
before_install:
- COMPOSER_FLAGS=$([ $RELEASE == "lowest" ] && echo "--prefer-lowest" || echo "")
- PHPUNIT_FLAGS=$([ $COVERAGE == "yes" ] && echo "--coverage-clover=coverage.xml" || echo "")

script: vendor/bin/phpunit
install:
- travis_retry composer update --no-interaction --no-suggest --prefer-dist --prefer-stable $COMPOSER_FLAGS

script:
- vendor/bin/phpunit $PHPUNIT_FLAGS

after_script:
- |
if [ $COVERAGE == "yes" ]; then
travis_retry wget https://scrutinizer-ci.com/ocular.phar
travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.xml
fi
18 changes: 0 additions & 18 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"illuminate/database": "~5.0"
},
"require-dev": {
"phpunit/phpunit": "~5.0"
"phpunit/phpunit": "~6.5"
},
"autoload": {
"psr-4": {
Expand Down
36 changes: 19 additions & 17 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,27 @@ protected function setUp()
$table->unsignedInteger('custom_post_id')->nullable();
});

Model::unguarded(function () {
Country::create(['id' => 1]);
Country::create(['id' => 2]);
Country::create(['id' => 3]);
Model::unguard();

User::create(['id' => 11, 'country_id' => 1, 'deleted_at' => null]);
User::create(['id' => 12, 'country_id' => 2, 'deleted_at' => null]);
User::create(['id' => 13, 'country_id' => 3, 'deleted_at' => Carbon::yesterday()]);
Country::create(['id' => 1]);
Country::create(['id' => 2]);
Country::create(['id' => 3]);

Post::create(['id' => 21, 'user_id' => 11, 'custom_user_id' => null]);
Post::create(['id' => 22, 'user_id' => 12, 'custom_user_id' => null]);
Post::create(['id' => 23, 'user_id' => 13, 'custom_user_id' => null]);
Post::create(['id' => 24, 'user_id' => null, 'custom_user_id' => 11]);
User::create(['id' => 11, 'country_id' => 1, 'deleted_at' => null]);
User::create(['id' => 12, 'country_id' => 2, 'deleted_at' => null]);
User::create(['id' => 13, 'country_id' => 3, 'deleted_at' => Carbon::now()->subDay()]);

Comment::create(['id' => 31, 'post_id' => 21, 'custom_post_id' => null]);
Comment::create(['id' => 32, 'post_id' => 22, 'custom_post_id' => null]);
Comment::create(['id' => 33, 'post_id' => 23, 'custom_post_id' => null]);
Comment::create(['id' => 34, 'post_id' => null, 'custom_post_id' => 21]);
Comment::create(['id' => 35, 'post_id' => null, 'custom_post_id' => 24]);
});
Post::create(['id' => 21, 'user_id' => 11, 'custom_user_id' => null]);
Post::create(['id' => 22, 'user_id' => 12, 'custom_user_id' => null]);
Post::create(['id' => 23, 'user_id' => 13, 'custom_user_id' => null]);
Post::create(['id' => 24, 'user_id' => null, 'custom_user_id' => 11]);

Comment::create(['id' => 31, 'post_id' => 21, 'custom_post_id' => null]);
Comment::create(['id' => 32, 'post_id' => 22, 'custom_post_id' => null]);
Comment::create(['id' => 33, 'post_id' => 23, 'custom_post_id' => null]);
Comment::create(['id' => 34, 'post_id' => null, 'custom_post_id' => 21]);
Comment::create(['id' => 35, 'post_id' => null, 'custom_post_id' => 24]);

Model::reguard();
}
}

0 comments on commit ac44d4a

Please sign in to comment.