From d578c44a37a33a91c4f2fdf0c5ea5c9109d43311 Mon Sep 17 00:00:00 2001 From: Brown Date: Sat, 6 Jun 2020 16:57:25 -0400 Subject: [PATCH] Add more mocking to tests --- .../Provider/FakeFileReferenceCacheProvider.php | 12 +++++++++++- .../Provider/ParserInstanceCacheProvider.php | 4 ++++ tests/ProjectCheckerTest.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/Internal/Provider/FakeFileReferenceCacheProvider.php b/tests/Internal/Provider/FakeFileReferenceCacheProvider.php index 32fd04bfc..e57f26cd7 100644 --- a/tests/Internal/Provider/FakeFileReferenceCacheProvider.php +++ b/tests/Internal/Provider/FakeFileReferenceCacheProvider.php @@ -55,7 +55,8 @@ class FakeFileReferenceCacheProvider extends \Psalm\Internal\Provider\FileRefere */ private $cached_file_maps = []; - public function __construct() { + public function __construct() + { $this->config = \Psalm\Config::getInstance(); } @@ -284,4 +285,13 @@ class FakeFileReferenceCacheProvider extends \Psalm\Internal\Provider\FileRefere { $this->cached_file_maps = $file_maps; } + + /** + * @param array $mixed_counts + * + * @return void + */ + public function setTypeCoverage(array $mixed_counts) + { + } } diff --git a/tests/Internal/Provider/ParserInstanceCacheProvider.php b/tests/Internal/Provider/ParserInstanceCacheProvider.php index 9bbc78178..2f41efc37 100644 --- a/tests/Internal/Provider/ParserInstanceCacheProvider.php +++ b/tests/Internal/Provider/ParserInstanceCacheProvider.php @@ -97,4 +97,8 @@ class ParserInstanceCacheProvider extends \Psalm\Internal\Provider\ParserCachePr { $this->file_contents_cache[$file_path] = $file_contents; } + + public function saveFileContentHashes() + { + } } diff --git a/tests/ProjectCheckerTest.php b/tests/ProjectCheckerTest.php index a166d744f..af5e5f36d 100644 --- a/tests/ProjectCheckerTest.php +++ b/tests/ProjectCheckerTest.php @@ -187,7 +187,7 @@ class ProjectCheckerTest extends TestCase $this->assertSame(0, \Psalm\IssueBuffer::getErrorCount()); $this->assertSame( - 'No files analyzed', + 'Psalm was able to infer types for 100% of the codebase', $this->project_analyzer->getCodebase()->analyzer->getTypeInferenceSummary( $this->project_analyzer->getCodebase() )