mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #9443 from weirdan/require-php-tag-in-tests
This commit is contained in:
commit
b1b20106ad
@ -51,6 +51,11 @@ trait InvalidCodeAnalysisTestTrait
|
||||
$this->markTestSkipped('Skipped due to a bug.');
|
||||
}
|
||||
|
||||
// sanity check - do we have a PHP tag?
|
||||
if (strpos($code, '<?php') === false) {
|
||||
$this->fail('Test case must have a <?php tag');
|
||||
}
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$code = str_replace("\n", "\r\n", $code);
|
||||
}
|
||||
|
@ -55,6 +55,11 @@ trait ValidCodeAnalysisTestTrait
|
||||
$this->markTestSkipped('Skipped due to a bug.');
|
||||
}
|
||||
|
||||
// sanity check - do we have a PHP tag?
|
||||
if (strpos($code, '<?php') === false) {
|
||||
$this->fail('Test case must have a <?php tag');
|
||||
}
|
||||
|
||||
foreach ($ignored_issues as $issue_name) {
|
||||
Config::getInstance()->setCustomErrorLevel($issue_name, Config::REPORT_SUPPRESS);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user