mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
get data from dataabse and upload/download storage chart
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Tests\Domain\Traffic;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Storage;
|
||||
use Tests\TestCase;
|
||||
use App\Users\Models\User;
|
||||
@@ -186,4 +187,28 @@ class TrafficTest extends TestCase
|
||||
'download' => $document->getSize(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_user_traffic_test()
|
||||
{
|
||||
$user = User::factory()
|
||||
->create();
|
||||
|
||||
foreach (range(0, 30) as $day) {
|
||||
DB::table('traffic')->insert([
|
||||
'id' => Str::uuid(),
|
||||
'user_id' => $user->id,
|
||||
'upload' => random_int(11111111, 99999999),
|
||||
'download' => random_int(11111111, 99999999),
|
||||
'created_at' => now()->subDays($day),
|
||||
'updated_at' => now()->subDays($day),
|
||||
]);
|
||||
}
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/api/user/storage')
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user