generated from yiisoft/package-template
/
ProcessOnAutoloadDumpTest.php
38 lines (30 loc) · 1.02 KB
/
ProcessOnAutoloadDumpTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
namespace Yiisoft\Config\Tests\Integration\ProcessOnAutoloadDump;
use Yiisoft\Config\Composer\Options;
use Yiisoft\Config\Tests\Integration\IntegrationTestCase;
final class ProcessOnAutoloadDumpTest extends IntegrationTestCase
{
public function testBase(): void
{
$rootPath = __DIR__;
$packages = [
'test/a' => __DIR__ . '/packages/a',
'test/b' => __DIR__ . '/packages/b',
];
$mergePlanPath = $rootPath . '/' . Options::DEFAULT_MERGE_PLAN_FILE;
$this->runComposerUpdate(
rootPath: $rootPath,
packages: $packages,
);
$mergePlanContent = file_get_contents($mergePlanPath);
unlink($mergePlanPath);
$this->runComposerCommand(
['command' => 'dump-autoload'],
rootPath: $rootPath,
packages: $packages,
);
$this->assertFileExists($mergePlanPath);
$this->assertSame($mergePlanContent, file_get_contents($mergePlanPath));
}
}