forked from lamtranb/laravel-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelpersTest.php
43 lines (36 loc) · 995 Bytes
/
HelpersTest.php
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
36
37
38
39
40
41
42
43
<?php
namespace Nwidart\Modules\Tests;
use Illuminate\Support\Str;
class HelpersTest extends BaseTestCase
{
/**
* @var \Illuminate\Filesystem\Filesystem
*/
private $finder;
/**
* @var string
*/
private $modulePath;
public function setUp(): void
{
parent::setUp();
$this->modulePath = base_path('modules/Blog');
$this->finder = $this->app['files'];
$this->artisan('module:make', ['name' => ['Blog']]);
}
public function tearDown(): void
{
$this->finder->deleteDirectory($this->modulePath);
parent::tearDown();
}
/** @test */
public function it_finds_the_module_path()
{
$this->assertTrue(Str::contains(module_path('Blog'), 'modules/Blog'));
}
/** @test */
public function it_can_bind_a_relative_path_to_module_path()
{
$this->assertTrue(Str::contains(module_path('Blog', 'config/config.php'), 'modules/Blog/config/config.php'));
}
}