forked from tursodatabase/libsql-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPest.php
39 lines (32 loc) · 852 Bytes
/
Pest.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
<?php
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Libsql\Laravel\Tests\TestCase;
uses(
TestCase::class,
)->in(__DIR__);
function migrateTables(...$tableNames): void
{
collect($tableNames)
->each(function (string $tableName) {
$migration = include __DIR__ . '/Fixtures/Migrations/create_' . Str::snake(Str::plural($tableName)) . '_table.php';
$migration->up();
});
}
function test_database_path(string $path): string
{
return __DIR__ . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . $path;
}
function clearDirectory(): void
{
$path = __DIR__ . DIRECTORY_SEPARATOR . 'database';
$files = File::allFiles($path);
// Delete all files
foreach ($files as $file) {
File::delete($file);
}
}
function shouldSkipTests()
{
return true;
}