mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix a few issues in tests
This commit is contained in:
parent
6e6106c080
commit
37e8b4adfe
18
psalm.xml
18
psalm.xml
@ -18,24 +18,6 @@
|
||||
<MisplacedRequiredParam errorLevel="suppress" />
|
||||
<NullOperand errorLevel="suppress" />
|
||||
|
||||
<InvalidArgument>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
</errorLevel>
|
||||
</InvalidArgument>
|
||||
|
||||
<MissingReturnType>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
</errorLevel>
|
||||
</MissingReturnType>
|
||||
|
||||
<MissingPropertyType>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
</errorLevel>
|
||||
</MissingPropertyType>
|
||||
|
||||
<MixedArgument>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
|
@ -30,6 +30,9 @@ class Union extends Type
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return implode(
|
||||
|
@ -8,8 +8,6 @@ use Psalm\Config;
|
||||
|
||||
class ConfigTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $file_filter;
|
||||
|
||||
/** @var \Psalm\Checker\ProjectChecker */
|
||||
protected $project_checker;
|
||||
|
||||
@ -30,11 +28,19 @@ class ConfigTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
return array_filter(
|
||||
array_map(
|
||||
/**
|
||||
* @param string $file_name
|
||||
* @return string
|
||||
*/
|
||||
function ($file_name) {
|
||||
return substr($file_name, 0, -4);
|
||||
},
|
||||
scandir(dirname(__DIR__) . '/src/Psalm/Issue')
|
||||
),
|
||||
/**
|
||||
* @param string $issue_name
|
||||
* @return bool
|
||||
*/
|
||||
function ($issue_name) {
|
||||
return !empty($issue_name) && $issue_name !== 'CodeError' && $issue_name !== 'CodeIssue';
|
||||
}
|
||||
@ -138,6 +144,10 @@ class ConfigTest extends PHPUnit_Framework_TestCase
|
||||
$all_possible_handlers = implode(
|
||||
' ',
|
||||
array_map(
|
||||
/**
|
||||
* @param string $issue_name
|
||||
* @return string
|
||||
*/
|
||||
function ($issue_name) {
|
||||
return '<' . $issue_name . ' errorLevel="suppress" />' . PHP_EOL;
|
||||
},
|
||||
|
@ -13,7 +13,6 @@ class IncludeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/** @var \Psalm\Checker\ProjectChecker */
|
||||
protected $project_checker;
|
||||
protected static $file_filter;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
|
@ -13,7 +13,6 @@ class IssueSuppressionTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/** @var \Psalm\Checker\ProjectChecker */
|
||||
protected $project_checker;
|
||||
protected static $file_filter;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
|
@ -14,7 +14,6 @@ class PropertyTypeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/** @var \Psalm\Checker\ProjectChecker */
|
||||
protected $project_checker;
|
||||
protected static $file_filter;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
|
@ -14,7 +14,6 @@ class ScopeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/** @var \Psalm\Checker\ProjectChecker */
|
||||
protected $project_checker;
|
||||
protected static $file_filter;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
@ -523,8 +522,6 @@ class ScopeTest extends PHPUnit_Framework_TestCase
|
||||
echo $a;
|
||||
');
|
||||
|
||||
Config::getInstance()->setIssueHandler('PossiblyUndefinedVariable', self::$file_filter);
|
||||
|
||||
$file_checker = new FileChecker('somefile.php', $this->project_checker, $stmts);
|
||||
$file_checker->visitAndAnalyzeMethods();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user