-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite more tests to use TypeInferenceTestCase instead of LevelsTest…
…Case
- Loading branch information
1 parent
1fcd8ca
commit 673b115
Showing
16 changed files
with
68 additions
and
172 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
tests/DoctrineIntegration/ODM/DocumentManagerIntegrationTest.php
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
tests/DoctrineIntegration/ODM/DocumentManagerTypeInferenceTest.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,44 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\DoctrineIntegration\ODM; | ||
|
||
use PHPStan\Testing\TypeInferenceTestCase; | ||
use const PHP_VERSION_ID; | ||
|
||
class DocumentManagerTypeInferenceTest extends TypeInferenceTestCase | ||
{ | ||
|
||
/** | ||
* @return iterable<mixed> | ||
*/ | ||
public function dataFileAsserts(): iterable | ||
{ | ||
if (PHP_VERSION_ID >= 80000) { | ||
return []; | ||
} | ||
|
||
yield from $this->gatherAssertTypes(__DIR__ . '/data/documentManagerDynamicReturn.php'); | ||
yield from $this->gatherAssertTypes(__DIR__ . '/data/documentRepositoryDynamicReturn.php'); | ||
yield from $this->gatherAssertTypes(__DIR__ . '/data/documentManagerMergeReturn.php'); | ||
yield from $this->gatherAssertTypes(__DIR__ . '/data/customRepositoryUsage.php'); | ||
} | ||
|
||
/** | ||
* @dataProvider dataFileAsserts | ||
* @param mixed ...$args | ||
*/ | ||
public function testFileAsserts( | ||
string $assertType, | ||
string $file, | ||
...$args | ||
): void | ||
{ | ||
$this->assertFileAsserts($assertType, $file, ...$args); | ||
} | ||
|
||
public static function getAdditionalConfigFiles(): array | ||
{ | ||
return [__DIR__ . '/phpstan.neon']; | ||
} | ||
|
||
} |
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/customRepositoryUsage-2.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/customRepositoryUsage-4.json
This file was deleted.
Oops, something went wrong.
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
17 changes: 0 additions & 17 deletions
17
tests/DoctrineIntegration/ODM/data/documentManagerDynamicReturn-2.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/documentManagerDynamicReturn-4.json
This file was deleted.
Oops, something went wrong.
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
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/documentManagerMergeReturn-4.json
This file was deleted.
Oops, something went wrong.
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
22 changes: 0 additions & 22 deletions
22
tests/DoctrineIntegration/ODM/data/documentRepositoryDynamicReturn-2.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/documentRepositoryDynamicReturn-4.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
tests/DoctrineIntegration/ODM/data/documentRepositoryDynamicReturn-6.json
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
tests/DoctrineIntegration/ODM/data/documentRepositoryDynamicReturn-7.json
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
includes: | ||
- ../../../extension.neon | ||
- phar://phpstan.phar/conf/bleedingEdge.neon | ||
|
||
parameters: | ||
doctrine: | ||
|