1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/tests/Config/CreatorTest.php

53 lines
1.2 KiB
PHP
Raw Normal View History

<?php
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;
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
{
public static function setUpBeforeClass(): void
{
}
public function setUp(): void
{
}
public function testDiscoverLibDirectory(): void
{
$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',
);
$this->assertSame('<?xml version="1.0"?>
<psalm
2020-02-18 04:43:13 +01:00
errorLevel="1"
resolveFromConfigFile="true"
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"
>
<projectFiles>
<directory name="lib" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
', $lib_contents);
}
}