Skip to content

Commit e914a91

Browse files
committed
add test
1 parent 4b7aa41 commit e914a91

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Rules/Doctrine/NoDocumentMockingRule/NoDocumentMockingRuleTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55
namespace Symplify\PHPStanRules\Tests\Rules\Doctrine\NoDocumentMockingRule;
66

77
use Iterator;
8+
<<<<<<< HEAD
89
use Override;
910
use PHPStan\Rules\Rule;
1011
use PHPStan\Testing\RuleTestCase;
1112
use PHPUnit\Framework\Attributes\DataProvider;
1213
use Symplify\PHPStanRules\Rules\Doctrine\NoDocumentMockingRule;
14+
=======
15+
use PHPStan\Reflection\ReflectionProvider;
16+
use PHPStan\Rules\Rule;
17+
use PHPStan\Testing\RuleTestCase;
18+
use PHPUnit\Framework\Attributes\DataProvider;
19+
use Symplify\PHPStanRules\Rules\Doctrine\NoGetRepositoryOnServiceRepositoryEntityRule;
20+
use Symplify\PHPStanRules\Tests\Rules\Doctrine\NoGetRepositoryOnServiceRepositoryEntityRule\Source\Repository\SomeServiceRepository;
21+
>>>>>>> 0ffdc220 (add test)
1322

1423
final class NoDocumentMockingRuleTest extends RuleTestCase
1524
{
@@ -27,14 +36,21 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines
2736
*/
2837
public static function provideData(): Iterator
2938
{
39+
<<<<<<< HEAD
3040
yield [__DIR__ . '/Fixture/SomeEntityMocking.php', [[
3141
NoDocumentMockingRule::ERROR_MESSAGE,
42+
=======
43+
$errorMessage = sprintf(NoGetRepositoryOnServiceRepositoryEntityRule::ERROR_MESSAGE, 'SomeEntity', SomeServiceRepository::class);
44+
yield [__DIR__ . '/Fixture/SomeEntityMocking.php', [[
45+
$errorMessage,
46+
>>>>>>> 0ffdc220 (add test)
3247
14,
3348
]]];
3449

3550
yield [__DIR__ . '/Fixture/SomeAbstractEntityMocking.php', []];
3651
}
3752

53+
<<<<<<< HEAD
3854
/**
3955
* @return string[]
4056
*/
@@ -47,5 +63,12 @@ public static function getAdditionalConfigFiles(): array
4763
protected function getRule(): Rule
4864
{
4965
return self::getContainer()->getByType(NoDocumentMockingRule::class);
66+
=======
67+
protected function getRule(): Rule
68+
{
69+
$reflectionProvider = self::getContainer()->getByType(ReflectionProvider::class);
70+
71+
return new NoGetRepositoryOnServiceRepositoryEntityRule($reflectionProvider);
72+
>>>>>>> 0ffdc220 (add test)
5073
}
5174
}

0 commit comments

Comments
 (0)