Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard van Velzen committed Apr 29, 2022
1 parent 2a6ab74 commit e845ca1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,7 @@ public function testBug7135(): void

$errors = $this->runAnalyse(__DIR__ . '/data/bug-7135.php');
$this->assertCount(1, $errors);
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool, int): bool, Closure(int, bool): bool given', $errors[0]->getMessage());
$this->assertSame(38, $errors[0]->getMessage());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool, int): bool, Closure(int): bool given', $errors[0]->getMessage());
$this->assertSame(45, $errors[0]->getMessage());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(int): bool, Closure(bool): bool given', $errors[0]->getMessage());
$this->assertSame(52, $errors[0]->getMessage());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool): bool, Closure(int): bool given', $errors[0]->getMessage());
$this->assertSame(59, $errors[0]->getMessage());
$this->assertSame('Cannot create callable from the new operator.', $errors[0]->getMessage());
}

public function testDiscussion7124(): void
Expand All @@ -786,6 +779,14 @@ public function testDiscussion7124(): void

$errors = $this->runAnalyse(__DIR__ . '/data/discussion-7124.php');
$this->assertCount(4, $errors);
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool, int): bool, Closure(int, bool): bool given.', $errors[0]->getMessage());
$this->assertSame(37, $errors[0]->getLine());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool, int): bool, Closure(int): bool given.', $errors[1]->getMessage());
$this->assertSame(44, $errors[1]->getLine());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(int): bool, Closure(bool): bool given.', $errors[2]->getMessage());
$this->assertSame(51, $errors[2]->getLine());
$this->assertSame('Parameter #2 $callback of function Discussion7124\filter expects callable(bool): bool, Closure(int): bool given.', $errors[3]->getMessage());
$this->assertSame(58, $errors[3]->getLine());
}

/**
Expand Down

0 comments on commit e845ca1

Please sign in to comment.