From 0ccd69f8b0b88b2172bd0c8802bd94a0b2866831 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Sat, 9 Dec 2023 18:33:31 -0600 Subject: [PATCH 1/2] Fix test namespaces Signed-off-by: Nathanael Esayeas --- tests/PHP80/Php80LanguageFeaturesTest.php | 2 +- tests/PHP81/Php81LanguageFeaturesTest.php | 2 +- tests/PHP82/Php82LanguageFeaturesTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/PHP80/Php80LanguageFeaturesTest.php b/tests/PHP80/Php80LanguageFeaturesTest.php index bacc8643d..7bea3b2eb 100644 --- a/tests/PHP80/Php80LanguageFeaturesTest.php +++ b/tests/PHP80/Php80LanguageFeaturesTest.php @@ -1,6 +1,6 @@ Date: Sat, 9 Dec 2023 19:21:16 -0600 Subject: [PATCH 2/2] Use FQCN instead of string Signed-off-by: Nathanael Esayeas --- tests/PHP80/Php80LanguageFeaturesTest.php | 4 ++-- tests/PHP81/Php81LanguageFeaturesTest.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/PHP80/Php80LanguageFeaturesTest.php b/tests/PHP80/Php80LanguageFeaturesTest.php index 7bea3b2eb..d4217048d 100644 --- a/tests/PHP80/Php80LanguageFeaturesTest.php +++ b/tests/PHP80/Php80LanguageFeaturesTest.php @@ -16,7 +16,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase { public function testMockingIteratorAggregateDoesNotImplementIterator() { - $mock = mock('test\Mockery\ImplementsIteratorAggregate'); + $mock = mock(ImplementsIteratorAggregate::class); $this->assertInstanceOf('IteratorAggregate', $mock); $this->assertInstanceOf('Traversable', $mock); $this->assertNotInstanceOf('Iterator', $mock); @@ -24,7 +24,7 @@ public function testMockingIteratorAggregateDoesNotImplementIterator() public function testMockingIteratorDoesNotImplementIterator() { - $mock = mock('test\Mockery\ImplementsIterator'); + $mock = mock(ImplementsIterator::class); $this->assertInstanceOf('Iterator', $mock); $this->assertInstanceOf('Traversable', $mock); } diff --git a/tests/PHP81/Php81LanguageFeaturesTest.php b/tests/PHP81/Php81LanguageFeaturesTest.php index a12079309..39da847ea 100644 --- a/tests/PHP81/Php81LanguageFeaturesTest.php +++ b/tests/PHP81/Php81LanguageFeaturesTest.php @@ -5,6 +5,7 @@ use DateTime; use Mockery; use Mockery\Adapter\Phpunit\MockeryTestCase; +use PDO; use ReturnTypeWillChange; use RuntimeException; use Serializable; @@ -24,7 +25,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase */ public function canMockClassesThatImplementSerializable() { - $mock = mock("test\Mockery\ClassThatImplementsSerializable"); + $mock = mock(ClassThatImplementsSerializable::class); $this->assertInstanceOf("Serializable", $mock); } @@ -41,9 +42,9 @@ public function it_can_mock_an_internal_class_with_tentative_return_types() */ public function it_can_mock_an_internal_class_with_tentative_union_return_types() { - $mock = Mockery::mock('PDO'); + $mock = Mockery::mock(PDO::class); - $this->assertInstanceOf('PDO', $mock); + $this->assertInstanceOf(PDO::class, $mock); $mock->shouldReceive('exec')->once();