-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
0 deletions.
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
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,35 @@ | ||
<?php | ||
|
||
namespace Prophecy\PhpUnit\Tests\PhpstanFixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Prophecy\PhpUnit\ProphecyTrait; | ||
use Prophecy\Prophecy\ObjectProphecy; | ||
|
||
class ExampleUsage extends TestCase | ||
{ | ||
use ProphecyTrait; | ||
|
||
public function testExplicitClass(): void | ||
{ | ||
$prophecy = $this->prophesize(\DateTimeImmutable::class); | ||
|
||
$this->configureDouble($prophecy); | ||
|
||
$double = $prophecy->reveal(); | ||
|
||
$this->checkValue($double->format('Y-m-d')); | ||
} | ||
|
||
/** | ||
* @param ObjectProphecy<\DateTimeImmutable> $double | ||
*/ | ||
private function configureDouble(ObjectProphecy $double): void | ||
{ | ||
} | ||
|
||
private function checkValue(string $value): void | ||
{ | ||
self::assertNotEmpty($value); | ||
} | ||
} |
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,11 @@ | ||
parameters: | ||
level: 9 | ||
treatPhpDocTypesAsCertain: false | ||
paths: | ||
- ./src/ | ||
- ./phpstan-fixtures/ | ||
ignoreErrors: | ||
# recordDoubledType exist only in PHPUnit < 10 but the code is checking that before using it. | ||
- | ||
message: '#^Call to an undefined method Prophecy\\PhpUnit\\Tests\\PhpstanFixtures\\[^:]++\:\:recordDoubledType\(\)\.$#' | ||
path: src/ProphecyTrait.php |
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