-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathBaseTest.php
42 lines (34 loc) · 1.12 KB
/
BaseTest.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
<?php
/**
* @author Aaron Francis <[email protected]|https://twitter.com/aarondfrancis>
*/
namespace AaronFrancis\Airdrop\Tests;
use AaronFrancis\Airdrop\AirdropServiceProvider;
use Illuminate\Support\Facades\File;
use Orchestra\Testbench\TestCase;
abstract class BaseTest extends TestCase
{
protected function getPackageProviders($app)
{
return [
AirdropServiceProvider::class
];
}
protected function setUp(): void
{
parent::setUp();
// By default base_path points to the TestBench directory,
// but we need it to reference our app. Adding this link
// will make it transparent.
if (!File::exists(base_path() . '/tests/Support')) {
// Support for older versions of testbench that don't have a tests directory.
File::ensureDirectoryExists(base_path() . '/tests');
exec('ln -sf ' . __DIR__ . '/Support ' . base_path() . '/tests/Support');
}
}
protected function tearDown(): void
{
parent::tearDown();
File::deleteDirectory(base_path('storage/framework/testing'));
}
}