diff --git a/tests/ProjectCodeTest.php b/tests/ProjectCodeTest.php index ef869ea8..e6192090 100644 --- a/tests/ProjectCodeTest.php +++ b/tests/ProjectCodeTest.php @@ -105,6 +105,24 @@ public function testHasThrowsAnnotation($method) } + /** + * @dataProvider provideMethods + * + * @param ReflectionMethod $method + */ + public function testHasCorrespondingStaticAnalysisFile($method) + { + $doc = $method->getDocComment(); + if($doc === false || strpos($doc, '@psalm-assert') === false) { + $this->addToAssertionCount(1); + return; + } + + $this->assertFileExists( + __DIR__ . '/static-analysis/assert-'. $method->getName() . '.php' + ); + } + /** * @return array */ @@ -150,7 +168,5 @@ private function getMethods() } return $methods; - } - }