-
-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathMenuMakeCommandTest.php
More file actions
34 lines (27 loc) · 763 Bytes
/
MenuMakeCommandTest.php
File metadata and controls
34 lines (27 loc) · 763 Bytes
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
<?php
namespace Styde\Html\Tests;
use Illuminate\Support\Facades\Artisan;
class MenuMakeCommandTest extends TestCase
{
/** @test */
function it_can_run_the_make_command()
{
$this->cleanDirectory();
$result = Artisan::call('make:menu', ['name' => 'UserMenu']);
$this->assertDirectoryExists(app_path('Menus'));
$this->assertFileExists(app_path('Menus/UserMenu.php'));
}
protected function rmFile($filename)
{
if (file_exists($filename)) {
unlink($filename);
}
}
protected function cleanDirectory()
{
$this->rmFile(app_path('Menus/UserMenu.php'));
if (is_dir(app_path('Http/Menus'))) {
rmdir(app_path('Http/Menus'));
}
}
}