diff --git a/tests/DeadCodeTest.php b/tests/DeadCodeTest.php index 170e9e6c3..1be5ac2cb 100644 --- a/tests/DeadCodeTest.php +++ b/tests/DeadCodeTest.php @@ -54,4 +54,29 @@ class DeadCodeTest extends PHPUnit_Framework_TestCase $context = new Context(); $file_checker->visitAndAnalyzeMethods($context); } + + /** + * @expectedException \Psalm\Exception\CodeException + * @expectedExceptionMessage DeadCode + * @return void + */ + public function testIfInFunction() + { + $stmts = self::$parser->parse('project_checker, $stmts); + $context = new Context(); + $file_checker->visitAndAnalyzeMethods($context); + } }