Skip to content

Commit 64908ce

Browse files
adds test for long version
1 parent a288c6b commit 64908ce

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

src/CLI/PhpArkitectApplication.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010

1111
class PhpArkitectApplication extends \Symfony\Component\Console\Application
1212
{
13-
/** @var string */
14-
private static $logo = <<< 'EOD'
15-
____ _ _ ____ _ _ _ _ _
16-
| _ \| | | | _ \ / \ _ __| | _(_) |_ ___ ___| |_
17-
| |_) | |_| | |_) / _ \ | '__| |/ / | __/ _ \/ __| __|
18-
| __/| _ | __/ ___ \| | | <| | || __/ (__| |_
19-
|_| |_| |_|_| /_/ \_\_| |_|\_\_|\__\___|\___|\__|
20-
EOD;
13+
private static string $logo = <<< 'EOD'
14+
____ _ _ ____ _ _ _ _ _
15+
| _ \| | | | _ \ / \ _ __| | _(_) |_ ___ ___| |_
16+
| |_) | |_| | |_) / _ \ | '__| |/ / | __/ _ \/ __| __|
17+
| __/| _ | __/ ___ \| | | <| | || __/ (__| |_
18+
|_| |_| |_|_| /_/ \_\_| |_|\_\_|\__\___|\___|\__|
19+
EOD;
2120

2221
public function __construct()
2322
{

tests/E2E/Cli/VersionCommandTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arkitect\Tests\E2E\Cli;
6+
7+
use Arkitect\CLI\PhpArkitectApplication;
8+
use PHPUnit\Framework\TestCase;
9+
use Symfony\Component\Console\Tester\ApplicationTester;
10+
11+
class VersionCommandTest extends TestCase
12+
{
13+
const SUCCESS_CODE = 0;
14+
15+
const ERROR_CODE = 1;
16+
17+
public function test_app_returns_version(): void
18+
{
19+
$input = ['--version'];
20+
$app = new PhpArkitectApplication();
21+
$app->setAutoExit(false);
22+
23+
$appTester = new ApplicationTester($app);
24+
$appTester->run($input);
25+
26+
self::assertStringContainsString('PHPArkitect version', $appTester->getDisplay());
27+
}
28+
}

0 commit comments

Comments
 (0)