Skip to content

Commit

Permalink
Support for PHP 8.0 (#439)
Browse files Browse the repository at this point in the history
* WIP

* Updated dependencies

* Update run-tests.yml
  • Loading branch information
pascalbaljet authored Nov 12, 2020
1 parent 3e55eaf commit 49631cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2, 7.1]
php: [8.0, 7.4]
dependency-version: [prefer-lowest, prefer-stable]

env:
Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "spatie/browsershot",
"description": "Convert a webpage to an image or pdf using headless Chrome",
"homepage": "https://github.com/spatie/browsershot",
"keywords":
[
"keywords": [
"convert",
"webpage",
"image",
Expand All @@ -23,14 +22,14 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.4|^8.0",
"spatie/image": "^1.5.3",
"spatie/temporary-directory": "^1.1",
"symfony/process": "^4.2|^5.0"
"symfony/process": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "^6.1|^7.5",
"spatie/phpunit-snapshot-assertions": "^1.0"
"phpunit/phpunit": "^9.0",
"spatie/phpunit-snapshot-assertions": "^4.2.3"
},
"autoload": {
"psr-4": {
Expand All @@ -48,4 +47,4 @@
"config": {
"sort-packages": true
}
}
}
8 changes: 4 additions & 4 deletions tests/BrowsershotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class BrowsershotTest extends TestCase
{
public function setUp()
public function setUp(): void
{
$this->emptyTempDirectory();
}
Expand All @@ -21,7 +21,7 @@ public function it_can_get_the_body_html()
$html = Browsershot::url('https://example.com')
->bodyHtml();

$this->assertContains('<h1>Example Domain</h1>', $html);
$this->assertStringContainsString('<h1>Example Domain</h1>', $html);
}

/** @test */
Expand All @@ -31,7 +31,7 @@ public function it_can_get_the_body_html_when_using_pipe()
->usePipe()
->bodyHtml();

$this->assertContains('<h1>Example Domain</h1>', $html);
$this->assertStringContainsString('<h1>Example Domain</h1>', $html);
}

/** @test */
Expand Down Expand Up @@ -1429,7 +1429,7 @@ public function it_will_connect_to_a_custom_ws_endpoint_and_take_screenshot()
->bodyHtml();

// If it's offline then this will fail.
$this->assertContains('chrome.browserless.io', $html);
$this->assertStringContainsString('chrome.browserless.io', $html);

/* Now that we now the domain is online, assert the screenshot.
* Although we can't be sure, because Browsershot itself falls back to launching a chromium instance in browser.js
Expand Down

0 comments on commit 49631cc

Please sign in to comment.