mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
added UserAccountTest
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Folder;
|
||||
use App\Models\Folder;
|
||||
use App\Http\Tools\Editor;
|
||||
use App\Http\Tools\Guardian;
|
||||
use App\Share;
|
||||
use App\User;
|
||||
use App\Zip;
|
||||
use App\Models\Share;
|
||||
use App\Models\User;
|
||||
use App\Models\Zip;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Http\Request;
|
||||
use App\File;
|
||||
use App\Models\File as UserFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
|
||||
@@ -13,7 +13,7 @@ class SetupService
|
||||
*/
|
||||
public function create_directories()
|
||||
{
|
||||
collect(['avatars', 'chunks', 'system', 'files', 'temp', 'zip',])
|
||||
collect(['avatars', 'chunks', 'system', 'files', 'temp', 'zip'])
|
||||
->each(function ($directory) {
|
||||
|
||||
// Create directory for local driver
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Artisan;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
34
tests/Feature/UserAccountTest.php
Normal file
34
tests/Feature/UserAccountTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UserAccountTest extends TestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_change_user_password_in_profile_settings()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->postJson('/api/user/password', [
|
||||
'current_password' => 'secret',
|
||||
'password' => 'VerySecretPassword',
|
||||
'password_confirmation' => 'VerySecretPassword',
|
||||
])->assertStatus(204);
|
||||
|
||||
// TODO: login s novym heslom
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\File;
|
||||
use App\Models\Folder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
@@ -73,23 +71,6 @@ class UserTest extends TestCase
|
||||
])->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_change_user_password_in_profile_settings()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->putJson('/user/password', [
|
||||
'current_password' => 'secret',
|
||||
'password' => 'VerySecretPassword',
|
||||
'password_confirmation' => 'VerySecretPassword',
|
||||
])->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user