-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deal with null type in PHP8.2 (#1205)
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace test\Mockery; | ||
|
||
use Mockery; | ||
use Mockery\Adapter\Phpunit\MockeryTestCase; | ||
|
||
/** | ||
* @requires PHP 8.2.0-dev | ||
*/ | ||
class Php82LanguageFeaturesTest extends MockeryTestCase | ||
{ | ||
/** @test */ | ||
public function it_can_mock_an_class_with_null_return_type() | ||
{ | ||
$mock = Mockery::mock(HasNullReturnType::class); | ||
|
||
$this->assertInstanceOf(HasNullReturnType::class, $mock); | ||
} | ||
} | ||
|
||
class HasNullReturnType | ||
{ | ||
public function getChildren(): null | ||
{ | ||
return null; | ||
} | ||
} |