-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use different data fixture for
entityRepositoryDynamicReturn
test o…
…n PHP 7.1
- Loading branch information
1 parent
f3fba3b
commit 9f40e7f
Showing
11 changed files
with
427 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ includes: | |
parameters: | ||
excludePaths: | ||
- tests/*/data/* | ||
- tests/*/data-php-*/* | ||
|
||
ignoreErrors: | ||
- | ||
|
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
39 changes: 39 additions & 0 deletions
39
tests/DoctrineIntegration/ORM/EntityRepositoryDynamicReturnIntegrationTest.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,39 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\DoctrineIntegration\ORM; | ||
|
||
use PHPStan\Testing\LevelsTestCase; | ||
|
||
final class EntityRepositoryDynamicReturnIntegrationTest extends LevelsTestCase | ||
{ | ||
|
||
/** | ||
* @return string[][] | ||
*/ | ||
public function dataTopics(): array | ||
{ | ||
return [ | ||
['entityRepositoryDynamicReturn'], | ||
]; | ||
} | ||
|
||
public function getDataPath(): string | ||
{ | ||
if (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION === 1) { | ||
return __DIR__ . '/data-php-7.1'; | ||
} | ||
|
||
return __DIR__ . '/data'; | ||
} | ||
|
||
public function getPhpStanExecutablePath(): string | ||
{ | ||
return __DIR__ . '/../../../vendor/phpstan/phpstan/phpstan'; | ||
} | ||
|
||
public function getPhpStanConfigPath(): string | ||
{ | ||
return __DIR__ . '/phpstan.neon'; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-0.json
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 @@ | ||
[ | ||
{ | ||
"message": "Call to method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findOneBy() - entity PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity does not have a field named $blah.", | ||
"line": 94, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findBy() - entity PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity does not have a field named $blah.", | ||
"line": 116, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Method Doctrine\\ORM\\EntityRepository<object>::createQueryBuilder() invoked with 0 parameters, 1-2 required.", | ||
"line": 239, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Could not analyse QueryBuilder with unknown beginning.", | ||
"line": 241, | ||
"ignorable": true | ||
} | ||
] |
47 changes: 47 additions & 0 deletions
47
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-2.json
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,47 @@ | ||
[ | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 89, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 101, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 110, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 120, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 142, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findByNonexistent().", | ||
"line": 148, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().", | ||
"line": 160, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findOneByNonexistent().", | ||
"line": 165, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::countByNonexistent().", | ||
"line": 174, | ||
"ignorable": true | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-4.json
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,7 @@ | ||
[ | ||
{ | ||
"message": "Strict comparison using === between int and 'foo' will always evaluate to false.", | ||
"line": 171, | ||
"ignorable": true | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-5.json
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,7 @@ | ||
[ | ||
{ | ||
"message": "Parameter #1 $className of method Doctrine\\Persistence\\ObjectManager::getRepository() expects class-string<nonexistentClass>, string given.", | ||
"line": 212, | ||
"ignorable": true | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-6.json
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,12 @@ | ||
[ | ||
{ | ||
"message": "Property PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\Example::$repository with generic class Doctrine\\ORM\\EntityRepository does not specify its types: TEntityClass", | ||
"line": 16, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Class PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\Bug180Repository extends generic class Doctrine\\ORM\\EntityRepository but does not specify its types: TEntityClass", | ||
"line": 232, | ||
"ignorable": true | ||
} | ||
] |
42 changes: 42 additions & 0 deletions
42
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-7.json
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,42 @@ | ||
[ | ||
{ | ||
"message": "Call to an undefined method object::doSomething().", | ||
"line": 31, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomethingElse().", | ||
"line": 32, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomething().", | ||
"line": 43, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomethingElse().", | ||
"line": 44, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomething().", | ||
"line": 52, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomethingElse().", | ||
"line": 53, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomething().", | ||
"line": 62, | ||
"ignorable": true | ||
}, | ||
{ | ||
"message": "Call to an undefined method object::doSomethingElse().", | ||
"line": 63, | ||
"ignorable": true | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
tests/DoctrineIntegration/ORM/data-php-7.1/entityRepositoryDynamicReturn-9.json
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,7 @@ | ||
[ | ||
{ | ||
"message": "Cannot cast mixed to int.", | ||
"line": 241, | ||
"ignorable": true | ||
} | ||
] |
Oops, something went wrong.