Passed
Pull Request — main (#3)
by Chema
02:25
created

GetCallbackUrlFeatureTest::test_default_values()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 9.9
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpLightningTest\Feature;
6
7
use Gacela\Framework\Bootstrap\GacelaConfig;
8
use Gacela\Framework\Gacela;
9
use PhpLightning\Invoice\Infrastructure\Command\CallbackUrlCommand;
10
use PHPUnit\Framework\TestCase;
11
use Symfony\Component\Console\Tester\CommandTester;
12
13
final class GetCallbackUrlFeatureTest extends TestCase
14
{
15
    protected function setUp(): void
16
    {
17
        Gacela::bootstrap(__DIR__, static function (GacelaConfig $config): void {
18
            $config->resetInMemoryCache();
19
            $config->addAppConfigKeyValues([
20
                'domain' => 'custom-domain',
21
                'receiver' => 'custom-receiver',
22
            ]);
23
        });
24
    }
25
26
    public function test_default_values(): void
27
    {
28
        $tester = new CommandTester(new CallbackUrlCommand());
29
        $tester->execute([]);
30
        $outputAsJson = json_decode($tester->getDisplay(), true);
31
32
        self::assertEquals([
33
            'callback' => 'https://custom-domain/custom-receiver',
34
            'maxSendable' => 10_000_000_000,
0 ignored issues
show
Bug introduced by
The constant PhpLightningTest\Feature\10_000_000_000 was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
35
            'minSendable' => 100_000,
0 ignored issues
show
Bug introduced by
The constant PhpLightningTest\Feature\100_000 was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
36
            'metadata' => '[["text/plain","Pay to custom-receiver@custom-domain"],["text/identifier","custom-receiver@custom-domain"]]',
37
            'tag' => 'payRequest',
38
            'commentAllowed' => false,
39
        ], $outputAsJson);
40
    }
41
}
42