mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-25 01:34:15 +01:00
41 lines
843 B
PHP
41 lines
843 B
PHP
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\Events\GroupDeleting;
|
|
use App\Models\Group;
|
|
use App\Models\TwoFAccount;
|
|
use Tests\ModelTestCase;
|
|
|
|
/**
|
|
* @covers \App\Models\Group
|
|
*/
|
|
class GroupModelTest extends ModelTestCase
|
|
{
|
|
/**
|
|
* @test
|
|
*/
|
|
public function test_model_configuration()
|
|
{
|
|
$this->runConfigurationAssertions(
|
|
new Group(),
|
|
['name'],
|
|
['created_at', 'updated_at'],
|
|
['*'],
|
|
[],
|
|
['id' => 'int', 'twofaccounts_count' => 'integer'],
|
|
['deleting' => GroupDeleting::class]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
*/
|
|
public function test_groups_relation()
|
|
{
|
|
$group = new Group();
|
|
$accounts = $group->twofaccounts();
|
|
$this->assertHasManyRelation($accounts, $group, new TwoFAccount());
|
|
}
|
|
}
|