diff --git a/.travis.yml b/.travis.yml index 08b2081..82c4bd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,33 +7,59 @@ cache: env: global: - - RUN_PHPUNIT=1 - RUN_PHPCS=0 matrix: include: - - php: 7.0 - env: RUN_PHPUNIT=0 - - php: 7.0 - env: RUN_PHPUNIT=0 COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - - php: 7.1 - env: RUN_PHPUNIT=0 - - php: 7.2 - - php: 7.3 - - php: 7.4 - env: RUN_PHPCS=1 + - php: '7.2' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.2' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.2' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.2' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.2' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.2' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-stable' + - php: '7.3' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.3' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.3' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.3' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.3' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.3' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-stable' + - php: '7.4' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.4' + env: LARAVEL='5.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.4' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.4' + env: LARAVEL='5.8.*' COMPOSER_FLAGS='--prefer-stable' + - php: '7.4' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-lowest' + - php: '7.4' + env: LARAVEL='^6.0' COMPOSER_FLAGS='--prefer-stable' RUN_PHPCS=1 before_script: - phpenv config-rm xdebug.ini || true install: - - | - if [[ $RUN_PHPUNIT = 0 ]]; then - # We assume the older PHP/Laravel versions and thus restore a working dependency system for them - composer remove --dev orchestra/testbench --no-interaction --no-update - fi - - travis_wait 20 travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist + - travis_retry composer remove phpro/grumphp --no-interaction --no-update --dev + - composer require "illuminate/support:${LARAVEL}" --no-interaction --no-update + - composer require "illuminate/console:${LARAVEL}" --no-interaction --no-update + - composer require "illuminate/filesystem:${LARAVEL}" --no-interaction --no-update + - composer require --dev "illuminate/config:${LARAVEL}" --no-interaction --no-update + - composer require --dev "illuminate/view:${LARAVEL}" --no-interaction --no-update + - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist --no-suggest script: + - vendor/bin/phpunit - if [[ $RUN_PHPCS = 1 ]]; then vendor/bin/phpcs --standard=psr2 src/; fi - - if [[ $RUN_PHPUNIT = 1 ]]; then vendor/bin/phpunit; fi diff --git a/composer.json b/composer.json index 59dc964..2b4cc26 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=7", + "php": ">=7.2", "illuminate/support": "^5.5|^6", "illuminate/console": "^5.5|^6", "illuminate/filesystem": "^5.5|^6", @@ -23,7 +23,8 @@ "illuminate/view": "^5.5|^6", "phpro/grumphp": "^0.14", "squizlabs/php_codesniffer": "^3", - "orchestra/testbench": "^4.4" + "orchestra/testbench": "^3|^4", + "mockery/mockery": "^1.3" }, "autoload": { "psr-4": { diff --git a/tests/Console/EloquentCommandTest.php b/tests/Console/EloquentCommandTest.php index 1ca3ef6..7baa5a9 100644 --- a/tests/Console/EloquentCommandTest.php +++ b/tests/Console/EloquentCommandTest.php @@ -14,12 +14,11 @@ class EloquentCommandTest extends TestCase public function testCommand() { $modelFilename = $this->getVendorModelFilename(); - - // Ensure the mixins are not present $modelSource = file_get_contents($modelFilename); - $this->assertStringNotContainsString('* @mixin \\Eloquent', $modelSource); - $this->assertStringNotContainsString('* @mixin \\Illuminate\\Database\\Eloquent\\Builder', $modelSource); - $this->assertStringNotContainsString('* @mixin \\Illuminate\\Database\\Query\\Builder', $modelSource); + if (false !== strpos($modelSource, '* @mixin')) { + $msg = sprintf('Class %s already contains the @mixin markers', Model::class); + $this->markTestSkipped($msg); + } $actualContent = null; $mockFilesystem = Mockery::mock(Filesystem::class);