mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-16 00:27:49 +02:00
Update & Complete API controllers tests and Unit tests
This commit is contained in:
@ -6,6 +6,7 @@ use App\Events\TwoFAccountDeleted;
|
||||
use App\Helpers\Helpers;
|
||||
use App\Models\TwoFAccount;
|
||||
use App\Services\SettingService;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Mockery\MockInterface;
|
||||
use Tests\ModelTestCase;
|
||||
@ -138,4 +139,16 @@ class TwoFAccountModelTest extends ModelTestCase
|
||||
|
||||
$this->assertEquals('YYYY====', $twofaccount->secret);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function test_user_relation()
|
||||
{
|
||||
$model = new TwoFAccount();
|
||||
$relation = $model->user();
|
||||
|
||||
$this->assertInstanceOf(BelongsTo::class, $relation);
|
||||
$this->assertEquals('user_id', $relation->getForeignKeyName());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user