-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support tests using
StrictMocking
trait / extending our test case a…
…nd using `DisableReturnValueGenerationForTestDoubles` (#67)
- Loading branch information
1 parent
d6ac7ef
commit 5337285
Showing
4 changed files
with
58 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
19 changes: 19 additions & 0 deletions
19
tests/phpstan/data/OurTestCaseExtendingAndUsingAttributeTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Phpstan\Lendable\PHPUnitExtensions\data; | ||
|
||
use Lendable\PHPUnitExtensions\TestCase; | ||
use PHPUnit\Framework\Attributes\DisableReturnValueGenerationForTestDoubles; | ||
use PHPUnit\Framework\Attributes\Test; | ||
|
||
#[DisableReturnValueGenerationForTestDoubles] | ||
class OurTestCaseExtendingAndUsingAttributeTest extends TestCase | ||
{ | ||
#[Test] | ||
public function loose_mock(): void | ||
{ | ||
$this->createMock(\ArrayAccess::class); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Phpstan\Lendable\PHPUnitExtensions\data; | ||
|
||
use Lendable\PHPUnitExtensions\StrictMocking; | ||
use PHPUnit\Framework\Attributes\DisableReturnValueGenerationForTestDoubles; | ||
use PHPUnit\Framework\Attributes\Test; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[DisableReturnValueGenerationForTestDoubles] | ||
class OurTraitUsingAndUsingAttributeTest extends TestCase | ||
{ | ||
use StrictMocking; | ||
|
||
#[Test] | ||
public function loose_mock(): void | ||
{ | ||
$this->createMock(\ArrayAccess::class); | ||
} | ||
} |