diff --git a/tests/FileDiffTest.php b/tests/FileDiffTest.php index 4f767e383..7f6465fbe 100644 --- a/tests/FileDiffTest.php +++ b/tests/FileDiffTest.php @@ -164,7 +164,6 @@ class FileDiffTest extends TestCase $b_doc = $b_stmt->getDocComment(); $this->assertNotNull($b_doc, var_export($a_doc, true)); - assert(!is_null($b_doc)); $this->assertNotSame($a_doc, $b_doc); @@ -188,7 +187,10 @@ class FileDiffTest extends TestCase if (isset($a_stmt->stmts)) { $this->assertTrue(isset($b_stmt->stmts)); - /** @psalm-suppress UndefinedPropertyFetch */ + /** + * @psalm-suppress UndefinedPropertyFetch + * @psalm-suppress MixedArgument + */ $this->assertTreesEqual($a_stmt->stmts, $b_stmt->stmts); } } diff --git a/tests/LanguageServer/SymbolLookupTest.php b/tests/LanguageServer/SymbolLookupTest.php index 6ce00b2ad..aefa43e5a 100644 --- a/tests/LanguageServer/SymbolLookupTest.php +++ b/tests/LanguageServer/SymbolLookupTest.php @@ -120,7 +120,6 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase $method_symbol_location = $codebase->getSymbolLocation('somefile.php', 'B\A::foo()'); $this->assertNotNull($method_symbol_location); - assert(!is_null($method_symbol_location)); $this->assertSame(10, $method_symbol_location->getLineNumber()); $this->assertSame(21, $method_symbol_location->getColumn()); @@ -128,7 +127,6 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase $property_symbol_location = $codebase->getSymbolLocation('somefile.php', 'B\A::$a'); $this->assertNotNull($property_symbol_location); - assert(!is_null($property_symbol_location)); $this->assertSame(6, $property_symbol_location->getLineNumber()); $this->assertSame(31, $property_symbol_location->getColumn()); @@ -136,7 +134,6 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase $constant_symbol_location = $codebase->getSymbolLocation('somefile.php', 'B\A::BANANA'); $this->assertNotNull($constant_symbol_location); - assert(!is_null($constant_symbol_location)); $this->assertSame(8, $constant_symbol_location->getLineNumber()); $this->assertSame(27, $constant_symbol_location->getColumn()); @@ -144,7 +141,6 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase $function_symbol_location = $codebase->getSymbolLocation('somefile.php', 'B\bar()'); $this->assertNotNull($function_symbol_location); - assert(!is_null($function_symbol_location)); $this->assertSame(13, $function_symbol_location->getLineNumber()); $this->assertSame(17, $function_symbol_location->getColumn()); } @@ -217,7 +213,6 @@ class SymbolLookupTest extends \Psalm\Tests\TestCase $symbol_at_position = $codebase->getReferenceAtPosition('somefile.php', new Position(10, 30)); $this->assertNotNull($symbol_at_position); - assert(!is_null($symbol_at_position)); $this->assertSame('type: int|null', $symbol_at_position[0]); diff --git a/tests/PluginListTest.php b/tests/PluginListTest.php index 9dd5a9b48..79b9c58ef 100644 --- a/tests/PluginListTest.php +++ b/tests/PluginListTest.php @@ -10,11 +10,13 @@ use Psalm\Internal\PluginManager\PluginList; /** @group PluginManager */ class PluginListTest extends TestCase { - /** @var ObjectProphecy */ + /** @var ObjectProphecy */ private $config_file; - /** @var ObjectProphecy */ + + /** @var ObjectProphecy */ private $config; - /** @var ObjectProphecy */ + + /** @var ObjectProphecy */ private $composer_lock; public function setUp() diff --git a/tests/ProjectCheckerTest.php b/tests/ProjectCheckerTest.php index 22bb91d24..6aed6511f 100644 --- a/tests/ProjectCheckerTest.php +++ b/tests/ProjectCheckerTest.php @@ -151,7 +151,10 @@ class ProjectAnalyzerTest extends TestCase ) ); - $this->project_analyzer->getCodebase()->config->after_codebase_populated[] = get_class($hook); + $hook_class = get_class($hook); + + /** @psalm-suppress TypeCoercion see vimeo/psalm#1397 */ + $this->project_analyzer->getCodebase()->config->after_codebase_populated[] = $hook_class; ob_start(); $this->project_analyzer->check('tests/DummyProject');