-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
- Loading branch information
Showing
3 changed files
with
53 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
35 changes: 35 additions & 0 deletions
35
tests/Type/Doctrine/QueryBuilder/Expr/BaseExpressionDynamicReturnTypeExtensionTest.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,35 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Type\Doctrine\QueryBuilder\Expr; | ||
|
||
use PHPStan\Testing\TypeInferenceTestCase; | ||
|
||
class BaseExpressionDynamicReturnTypeExtensionTest extends TypeInferenceTestCase | ||
{ | ||
|
||
/** @return iterable<mixed> */ | ||
public function dataFileAsserts(): iterable | ||
{ | ||
yield from $this->gatherAssertTypes(__DIR__ . '/../../data/QueryResult/baseExpressionAndOr.php'); | ||
} | ||
|
||
/** | ||
* @dataProvider dataFileAsserts | ||
* @param mixed ...$args | ||
*/ | ||
public function testFileAsserts( | ||
string $assertType, | ||
string $file, | ||
...$args | ||
): void | ||
{ | ||
$this->assertFileAsserts($assertType, $file, ...$args); | ||
} | ||
|
||
/** @return string[] */ | ||
public static function getAdditionalConfigFiles(): array | ||
{ | ||
return [__DIR__ . '/../../data/QueryResult/config.neon']; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
tests/Type/Doctrine/data/QueryResult/baseExpressionAndOr.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,16 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace QueryResult\CreateQuery; | ||
|
||
use Doctrine\ORM\Query\Expr\Andx; | ||
use function PHPStan\Testing\assertType; | ||
|
||
$and = new Andx(); | ||
$count1 = $and->count(); | ||
assertType("int<0, max>", $count1); | ||
|
||
$modifiedAnd = $and->add('a = b'); | ||
assertType("Doctrine\ORM\Query\Expr\Andx", $modifiedAnd); | ||
|
||
$string = $and->__toString(); | ||
assertType("string", $string); |