Skip to content

Commit

Permalink
Add has static analysis test (webmozarts#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
BackEndTea authored Nov 6, 2019
1 parent f66fcdc commit 6176403
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/ProjectCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -150,7 +168,5 @@ private function getMethods()
}

return $methods;

}

}

0 comments on commit 6176403

Please sign in to comment.