Skip to content

Commit

Permalink
Cleanup AnalyserIntegrationTest->runAnalyse()
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Mar 16, 2024
1 parent 7ceeb21 commit 6ad6fc9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Bug4288\MyClass;
use Bug4713\Service;
use ExtendingKnownClassWithCheck\Foo;
use PHPStan\File\FileHelper;
use PHPStan\Reflection\InitializerExprContext;
use PHPStan\Reflection\InitializerExprTypeResolver;
use PHPStan\Reflection\ParametersAcceptorSelector;
Expand Down Expand Up @@ -1307,13 +1306,11 @@ public function testBug10538(): void
private function runAnalyse(string $file, ?array $allAnalysedFiles = null): array
{
$file = $this->getFileHelper()->normalizePath($file);
/** @var Analyser $analyser */

$analyser = self::getContainer()->getByType(Analyser::class);
/** @var FileHelper $fileHelper */
$fileHelper = self::getContainer()->getByType(FileHelper::class);
$errors = $analyser->analyse([$file], null, null, true, $allAnalysedFiles)->getErrors();
foreach ($errors as $error) {
$this->assertSame($fileHelper->normalizePath($file), $error->getFilePath());
$this->assertSame($file, $error->getFilePath());
}

return $errors;
Expand Down

0 comments on commit 6ad6fc9

Please sign in to comment.