-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathCodeProviderInstallTest.php
More file actions
35 lines (28 loc) · 1.27 KB
/
Copy pathCodeProviderInstallTest.php
File metadata and controls
35 lines (28 loc) · 1.27 KB
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
<?php
declare(strict_types=1);
namespace DrevOps\VortexInstaller\Tests\Functional\Handlers;
use DrevOps\VortexInstaller\Prompts\Handlers\CodeProvider;
use DrevOps\VortexInstaller\Prompts\PromptManager;
use DrevOps\VortexInstaller\Tests\Functional\FunctionalTestCase;
use DrevOps\VortexInstaller\Utils\Env;
use PHPUnit\Framework\Attributes\CoversClass;
#[CoversClass(CodeProvider::class)]
class CodeProviderInstallTest extends AbstractInstallTestCase {
public static function dataProviderInstall(): array {
return [
'code provider, github' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(CodeProvider::id()), CodeProvider::GITHUB)),
static::cw(function (FunctionalTestCase $test): void {
$test->assertFileDoesNotExist(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.dist.md');
$test->assertFileContainsString(static::$sut . '/.github/PULL_REQUEST_TEMPLATE.md', 'Checklist before requesting a review');
}),
],
'code provider, other' => [
static::cw(fn() => Env::put(PromptManager::makeEnvName(CodeProvider::id()), CodeProvider::OTHER)),
static::cw(function (FunctionalTestCase $test): void {
$test->assertDirectoryDoesNotExist(static::$sut . '/.github');
}),
],
];
}
}