2019-05-10 01:19:33 +02:00
|
|
|
<?php
|
2021-12-15 04:58:32 +01:00
|
|
|
|
2019-05-10 01:19:33 +02:00
|
|
|
namespace Psalm\Tests\Config;
|
|
|
|
|
2019-07-05 22:24:00 +02:00
|
|
|
use Psalm\Config\Creator;
|
2021-12-03 20:11:20 +01:00
|
|
|
use Psalm\Tests\TestCase;
|
2019-05-10 01:19:33 +02:00
|
|
|
|
2021-06-08 04:55:21 +02:00
|
|
|
use function dirname;
|
|
|
|
|
|
|
|
use const DIRECTORY_SEPARATOR;
|
|
|
|
|
2021-12-03 20:11:20 +01:00
|
|
|
class CreatorTest extends TestCase
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
2021-12-05 18:51:26 +01:00
|
|
|
public static function setUpBeforeClass(): void
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-12-05 18:51:26 +01:00
|
|
|
public function setUp(): void
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-09-12 17:24:05 +02:00
|
|
|
public function testDiscoverLibDirectory(): void
|
2019-05-10 01:19:33 +02:00
|
|
|
{
|
|
|
|
$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,
|
2022-12-18 17:15:15 +01:00
|
|
|
'vendor',
|
2019-05-10 01:19:33 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertSame('<?xml version="1.0"?>
|
|
|
|
<psalm
|
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"
|
2023-01-18 01:30:43 +01:00
|
|
|
findUnusedBaselineEntry="true"
|
2019-05-10 01:19:33 +02:00
|
|
|
>
|
|
|
|
<projectFiles>
|
|
|
|
<directory name="lib" />
|
|
|
|
<ignoreFiles>
|
|
|
|
<directory name="vendor" />
|
|
|
|
</ignoreFiles>
|
|
|
|
</projectFiles>
|
|
|
|
</psalm>
|
|
|
|
', $lib_contents);
|
|
|
|
}
|
|
|
|
}
|