Skip to content

Commit

Permalink
Use different data fixture for entityRepositoryDynamicReturn test o…
Browse files Browse the repository at this point in the history
…n PHP 7.1
  • Loading branch information
ruudk authored and ondrejmirtes committed Jan 2, 2022
1 parent f3fba3b commit 9f40e7f
Show file tree
Hide file tree
Showing 11 changed files with 427 additions and 1 deletion.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ includes:
parameters:
excludePaths:
- tests/*/data/*
- tests/*/data-php-*/*

ignoreErrors:
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public function dataTopics(): array
{
return [
['entityManagerDynamicReturn'],
['entityRepositoryDynamicReturn'],
['entityManagerMergeReturn'],
['customRepositoryUsage'],
['queryBuilder'],
Expand Down
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';
}

}
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
}
]
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
}
]
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
}
]
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
}
]
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
}
]
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
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"message": "Cannot cast mixed to int.",
"line": 241,
"ignorable": true
}
]
Loading

0 comments on commit 9f40e7f

Please sign in to comment.