From 0426db1a2885300299212280a1125414928b3fa1 Mon Sep 17 00:00:00 2001 From: Romain Norberg Date: Fri, 1 Feb 2019 09:39:32 +0100 Subject: [PATCH 1/2] Upgrade PHPUnit - Php 7.2 required --- composer.json | 4 ++-- tests/Integration/AssertionTest.php | 2 +- tests/Integration/MatchesSnapshotTest.php | 12 ++++++------ tests/Unit/SnapshotTest.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index d27676c..3a950d4 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ } ], "require": { - "php": "^7.1", - "phpunit/phpunit": "^7.0", + "php": "^7.2", + "phpunit/phpunit": "^8.0", "symfony/yaml": "^4.2" }, "autoload": { diff --git a/tests/Integration/AssertionTest.php b/tests/Integration/AssertionTest.php index 0367050..2fceb00 100644 --- a/tests/Integration/AssertionTest.php +++ b/tests/Integration/AssertionTest.php @@ -10,7 +10,7 @@ class AssertionTest extends TestCase use ComparesSnapshotFiles; use MatchesSnapshots; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/Integration/MatchesSnapshotTest.php b/tests/Integration/MatchesSnapshotTest.php index 6afb2be..4de1374 100644 --- a/tests/Integration/MatchesSnapshotTest.php +++ b/tests/Integration/MatchesSnapshotTest.php @@ -4,14 +4,14 @@ use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; use Spatie\Snapshots\MatchesSnapshots; class MatchesSnapshotTest extends TestCase { use ComparesSnapshotFiles; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -331,7 +331,7 @@ public function it_can_update_a_file_snapshot_with_a_different_extension() $this->assertFileNotExists($oldSnapshot); } - private function expectIncompleteMatchesSnapshotTest(PHPUnit_Framework_MockObject_MockObject $matchesSnapshotMock, callable $assertions) + private function expectIncompleteMatchesSnapshotTest(MockObject $matchesSnapshotMock, callable $assertions) { $matchesSnapshotMock ->expects($this->once()) @@ -342,7 +342,7 @@ private function expectIncompleteMatchesSnapshotTest(PHPUnit_Framework_MockObjec $matchesSnapshotMock->markTestIncompleteIfSnapshotsHaveChanged(); } - private function expectFail(PHPUnit_Framework_MockObject_MockObject $matchesSnapshotMock) + private function expectFail(MockObject $matchesSnapshotMock) { $matchesSnapshotMock ->expects($this->once()) @@ -355,9 +355,9 @@ private function expectFailedMatchesSnapshotTest() } /** - * @return \PHPUnit_Framework_MockObject_MockObject + * @return \PHPUnit\Framework\MockObject\MockObject */ - private function getMatchesSnapshotMock(): PHPUnit_Framework_MockObject_MockObject + private function getMatchesSnapshotMock(): MockObject { $mockMethods = [ 'markTestIncomplete', diff --git a/tests/Unit/SnapshotTest.php b/tests/Unit/SnapshotTest.php index fc10d55..5f80bdc 100644 --- a/tests/Unit/SnapshotTest.php +++ b/tests/Unit/SnapshotTest.php @@ -15,7 +15,7 @@ class SnapshotTest extends TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ private $driver; - public function setUp() + public function setUp(): void { parent::setUp(); From 4d7036eec565ba04ee578c92bfa9b1fb1e459d54 Mon Sep 17 00:00:00 2001 From: Romain Norberg Date: Fri, 1 Feb 2019 09:49:42 +0100 Subject: [PATCH 2/2] fix styleci --- tests/Integration/MatchesSnapshotTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/MatchesSnapshotTest.php b/tests/Integration/MatchesSnapshotTest.php index 4de1374..07eb795 100644 --- a/tests/Integration/MatchesSnapshotTest.php +++ b/tests/Integration/MatchesSnapshotTest.php @@ -3,8 +3,8 @@ namespace Spatie\Snapshots\Test\Integration; use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\TestCase; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; use Spatie\Snapshots\MatchesSnapshots; class MatchesSnapshotTest extends TestCase