Skip to content

Commit d9d302a

Browse files
committed
Test new-app
1 parent 35fc6ae commit d9d302a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/Commands/NewAppTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/*
3+
* This file is part of Aplus.
4+
*
5+
* (c) Natan Felles <natanfelles@gmail.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace Tests\Commands;
11+
12+
use Aplus\Commands\NewApp;
13+
use Framework\CLI\Streams\Stdout;
14+
15+
/**
16+
* Class NewAppTest.
17+
*/
18+
final class NewAppTest extends TestCase
19+
{
20+
protected string $command = NewApp::class;
21+
22+
public function testNewApp() : void
23+
{
24+
$dir = \sys_get_temp_dir() . '/aplus-app';
25+
if (\is_dir($dir)) {
26+
\rmdir($dir);
27+
}
28+
Stdout::init();
29+
$this->console->exec('new-app ' . $dir);
30+
self::assertStringContainsString(
31+
'App Project structure created at "' . $dir . '"',
32+
Stdout::getContents()
33+
);
34+
}
35+
}

0 commit comments

Comments
 (0)