check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testCaughtDocumentedThrowCall() { Config::getInstance()->check_for_throws_docblock = true; Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testUncaughtUndocumentedThrowCall() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @expectedException \Psalm\Exception\CodeException * @expectedExceptionMessage UncaughtThrowInGlobalScope * * @return void */ public function testUncaughtDocumentedThrowCallInNamespace() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @expectedException \Psalm\Exception\CodeException * @expectedExceptionMessage UncaughtThrowInGlobalScope * * @return void */ public function testUncaughtThrow() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testCaughtThrow() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testUncaughtThrowWhenSuppressing() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testUncaughtThrowInNamespaceWhenSuppressing() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testUncaughtDocumentedThrowCallWhenSuppressing() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @return void */ public function testUncaughtDocumentedThrowCallInNamespaceWhenSuppressing() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } /** * @expectedException \Psalm\Exception\CodeException * @expectedExceptionMessage UncaughtThrowInGlobalScope * * @return void */ public function testUncaughtDocumentedThrowCallWhenSuppressingFirst() { Config::getInstance()->check_for_throws_in_global_scope = true; $this->addFile( 'somefile.php', 'analyzeFile('somefile.php', $context); } }