2019-05-10 01:19:33 +02:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests\Config;
|
|
|
|
|
2019-06-26 22:52:29 +02:00
|
|
|
use const DIRECTORY_SEPARATOR;
|
2019-07-05 22:24:00 +02:00
|
|
|
use function dirname;
|
|
|
|
use Psalm\Config\Creator;
|
2019-05-10 01:19:33 +02:00
|
|
|
|
|
|
|
class CreatorTest extends \Psalm\Tests\TestCase
|
|
|
|
{
|
2019-05-17 00:36:36 +02:00
|
|
|
public static function setUpBeforeClass() : void
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-05-17 00:36:36 +02:00
|
|
|
public function setUp() : void
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testDiscoverLibDirectory()
|
|
|
|
{
|
|
|
|
$lib_contents = Creator::getContents(
|
|
|
|
dirname(__DIR__, 1)
|
|
|
|
. DIRECTORY_SEPARATOR . 'fixtures'
|
|
|
|
. DIRECTORY_SEPARATOR . 'config_discovery'
|
|
|
|
. DIRECTORY_SEPARATOR . 'files_in_lib',
|
|
|
|
null,
|
2020-02-17 22:33:28 +01:00
|
|
|
1,
|
|
|
|
'vendor'
|
2019-05-10 01:19:33 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertSame('<?xml version="1.0"?>
|
|
|
|
<psalm
|
|
|
|
totallyTyped="true"
|
2020-02-18 04:43:13 +01:00
|
|
|
errorLevel="1"
|
2019-07-06 18:21:39 +02:00
|
|
|
resolveFromConfigFile="true"
|
2019-05-10 01:19:33 +02:00
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xmlns="https://getpsalm.org/schema/config"
|
|
|
|
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
|
|
|
>
|
|
|
|
<projectFiles>
|
|
|
|
<directory name="lib" />
|
|
|
|
<ignoreFiles>
|
|
|
|
<directory name="vendor" />
|
|
|
|
</ignoreFiles>
|
|
|
|
</projectFiles>
|
|
|
|
</psalm>
|
|
|
|
', $lib_contents);
|
|
|
|
}
|
|
|
|
}
|