1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Tests\Integration; |
4
|
|
|
|
5
|
|
|
use Tests\TestCase; |
6
|
|
|
|
7
|
|
|
class HelpersTest extends TestCase |
8
|
|
|
{ |
9
|
|
|
/** @test */ |
10
|
|
|
public function base_path_helper_function() |
11
|
|
|
{ |
12
|
|
|
$this->assertEquals(BASE_PATH, base_path()); |
13
|
|
|
$this->assertEquals(BASE_PATH.'/some/directory', base_path('some/directory')); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
/** @test */ |
17
|
|
|
public function config_path_helper_function() |
18
|
|
|
{ |
19
|
|
|
$this->assertEquals(BASE_PATH.'/config', config_path()); |
20
|
|
|
$this->assertEquals(BASE_PATH.'/config/vendor', config_path('vendor')); |
21
|
|
|
$this->assertEquals(BASE_PATH.'/config/custom.php', config_path('custom.php')); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** @test */ |
25
|
|
|
public function database_path_helper_function() |
26
|
|
|
{ |
27
|
|
|
$this->assertEquals(BASE_PATH.'/database', database_path()); |
28
|
|
|
$this->assertEquals(BASE_PATH.'/database/seeds', database_path('seeds')); |
29
|
|
|
$this->assertEquals(BASE_PATH.'/database/seeds/DatabaseSeeder.php', database_path('seeds/DatabaseSeeder.php')); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** @test */ |
33
|
|
|
public function resource_path_helper_function() |
34
|
|
|
{ |
35
|
|
|
$this->assertEquals(BASE_PATH.'/resources', resource_path()); |
36
|
|
|
$this->assertEquals(BASE_PATH.'/resources/assets/js', resource_path('assets/js')); |
37
|
|
|
$this->assertEquals(BASE_PATH.'/resources/assets/js/app.php', resource_path('assets/js/app.php')); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** @test */ |
41
|
|
|
public function storage_path_helper_function() |
42
|
|
|
{ |
43
|
|
|
$this->assertEquals(BASE_PATH.'/storage', storage_path()); |
44
|
|
|
$this->assertEquals(BASE_PATH.'/storage/logs', storage_path('logs')); |
45
|
|
|
$this->assertEquals(BASE_PATH.'/storage/logs/laravel.log', storage_path('logs/laravel.log')); |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
|