Skip to content

Commit

Permalink
Upgrade to laravel 8 (#43)
Browse files Browse the repository at this point in the history
* update dependencies to laravel 8 compatible ones.

* add laravel 8 to travis test matrix

* fix tests

* remove php 7.2 from travis test matrix

* enable self_accessor in style-ci

Co-authored-by: Lars Rudbeck Bak <[email protected]>
  • Loading branch information
larsrbak and Lars Rudbeck Bak authored Oct 8, 2020
1 parent 61552f1 commit b903a83
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 37 deletions.
3 changes: 0 additions & 3 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
preset: laravel

disabled:
- self_accessor
26 changes: 9 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ cache:
matrix:
fast_finish: true
include:
- php: 7.1
env: LARAVEL='5.5.*' PHPUNIT='6.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
env: LARAVEL='5.5.*' PHPUNIT='6.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='5.7.*' PHPUNIT='7.5.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='5.7.*' PHPUNIT='7.5.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='5.7.*' PHPUNIT='7.5.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='5.7.*' PHPUNIT='7.5.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.2
env: LARAVEL='6.*' PHPUNIT='^8.3' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='6.*' PHPUNIT='^8.3' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='6.*' PHPUNIT='^8.3' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
Expand All @@ -37,6 +21,14 @@ matrix:
env: LARAVEL='7.*' PHPUNIT='^8.3' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4
env: LARAVEL='7.*' PHPUNIT='^8.3' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='8.*' PHPUNIT='^9.0' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='8.*' PHPUNIT='^9.0' COMPOSER_FLAGS='--prefer-stable'
- php: 7.4
env: LARAVEL='8.*' PHPUNIT='^9.0' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4
env: LARAVEL='8.*' PHPUNIT='^9.0' COMPOSER_FLAGS='--prefer-stable'

before_install:
- travis_retry composer self-update
Expand All @@ -46,4 +38,4 @@ install:
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest

script:
- vendor/bin/phpunit
- vendor/bin/phpunit
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
}
},
"require": {
"php": ">=7.1.0",
"illuminate/container": "^5.5|^6.0|^7.0",
"illuminate/filesystem": "^5.5|^6.0|^7.0",
"illuminate/support": "^5.5|^6.0|^7.0",
"php": ">=7.3.0",
"illuminate/container": "6.*|7.*|8.*",
"illuminate/filesystem": "6.*|7.*|8.*",
"illuminate/support": "6.*|7.*|8.*",
"superbalist/laravel-google-cloud-storage": "^1.0|^2.2",
"guzzlehttp/guzzle": "^6.3"
"guzzlehttp/guzzle": "^6.3|^7.0.1"
},
"require-dev": {
"codedungeon/phpunit-result-printer": "^0.26.0",
"laravel/laravel": "5.5.*|^6.0|^7.0",
"codedungeon/phpunit-result-printer": "^0.28.0",
"laravel/laravel": "6.*|7.*|8.*",
"intervention/image": "^2.4",
"doctrine/dbal": "^2.5",
"mockery/mockery": "^1.3",
"rutorika/sortable": "^4.2|^6.0|^7.0",
"phpunit/phpunit": "^6.0|^7.0|^8.0",
"phpunit/phpunit": "8.*|9.*",
"fzaninotto/faker": "^1.4",
"league/flysystem": "^1.0.8"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/GeneratePlaceholdersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function it_generates_placeholders_and_sets_dimensions()

// It generates placeholder
$this->assertNotNull($placeholder = $image->refresh()->tiny_placeholder);
$this->assertContains('base64', $placeholder);
$this->assertStringContainsString('base64', $placeholder);

// It sets dimensions when NULL (for upgrading versions)
$this->assertNotNull($image->width);
Expand Down
14 changes: 7 additions & 7 deletions tests/Feature/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public function it_casts_to_a_responsive_html_img_tag()
{
$image = Image::upload(new File(__DIR__.'/../image.jpg'), 'test.jpg');

$this->assertContains('<img', $html = (string) $image);
$this->assertContains('srcset', $html = (string) $image);
$this->assertNotContains('sizes', $html = (string) $image);
$this->assertStringContainsString('<img', $html = (string) $image);
$this->assertStringContainsString('srcset', $html = (string) $image);
$this->assertStringNotContainsString('sizes', $html = (string) $image);
}

/** @test **/
Expand All @@ -81,9 +81,9 @@ public function it_casts_to_a_responsive_html_img_tag_with_placeholder_when_enab

$image = Image::upload(new File(__DIR__.'/../image.jpg'), 'test.jpg');

$this->assertContains('<img', $html = (string) $image);
$this->assertContains('srcset', $html = (string) $image);
$this->assertContains('sizes', $html = (string) $image);
$this->assertContains('onload', $html = (string) $image);
$this->assertStringContainsString('<img', $html = (string) $image);
$this->assertStringContainsString('srcset', $html = (string) $image);
$this->assertStringContainsString('sizes', $html = (string) $image);
$this->assertStringContainsString('onload', $html = (string) $image);
}
}
2 changes: 1 addition & 1 deletion tests/Feature/ResponsiveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function regression__it_handles_none_existent_images()
$this->assertEquals([], $responsive->get()->all());
$this->assertNull($responsive->getSrc());
$this->assertEquals('', $responsive->getSrcset());
$this->assertContains('src=""', $responsive->getHtml());
$this->assertStringContainsString('src=""', $responsive->getHtml());
$this->assertEquals([
'src' => null,
'srcset' => '',
Expand Down

0 comments on commit b903a83

Please sign in to comment.