mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
40 lines
859 B
PHP
40 lines
859 B
PHP
|
<?php
|
||
|
namespace Psalm\Tests;
|
||
|
|
||
|
use PhpParser\ParserFactory;
|
||
|
use PHPUnit_Framework_TestCase;
|
||
|
use Psalm\Checker\FileChecker;
|
||
|
|
||
|
class TestCase extends PHPUnit_Framework_TestCase
|
||
|
{
|
||
|
/** @var \PhpParser\Parser */
|
||
|
protected static $parser;
|
||
|
|
||
|
/** @var TestConfig */
|
||
|
protected static $config;
|
||
|
|
||
|
/** @var \Psalm\Checker\ProjectChecker */
|
||
|
protected $project_checker;
|
||
|
|
||
|
/**
|
||
|
* @return void
|
||
|
*/
|
||
|
public static function setUpBeforeClass()
|
||
|
{
|
||
|
parent::setUpBeforeClass();
|
||
|
self::$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return void
|
||
|
*/
|
||
|
public function setUp()
|
||
|
{
|
||
|
parent::setUp();
|
||
|
|
||
|
FileChecker::clearCache();
|
||
|
$this->project_checker = new \Psalm\Checker\ProjectChecker();
|
||
|
$this->project_checker->setConfig(new TestConfig());
|
||
|
}
|
||
|
}
|