mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-18 01:19:49 +02:00
Complete Unit, Feature and Api tests
This commit is contained in:
43
tests/Unit/GroupModelTest.php
Normal file
43
tests/Unit/GroupModelTest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Group;
|
||||
use App\TwoFAccount;
|
||||
use App\Events\GroupDeleting;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Tests\ModelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user