You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
PHTML
56 lines
1.3 KiB
PHTML
4 years ago
|
<?php
|
||
|
|
||
|
namespace Engelsystem\Test\Unit;
|
||
|
|
||
|
use Engelsystem\Models\Faq;
|
||
|
use Engelsystem\Models\Message;
|
||
|
use Engelsystem\Models\News;
|
||
|
use Engelsystem\Models\NewsComment;
|
||
|
use Engelsystem\Models\Question;
|
||
|
use Engelsystem\Models\Room;
|
||
|
use Engelsystem\Models\Shifts\Schedule;
|
||
|
use Engelsystem\Models\User\Contact;
|
||
|
use Engelsystem\Models\User\PasswordReset;
|
||
|
use Engelsystem\Models\User\PersonalData;
|
||
|
use Engelsystem\Models\User\Settings;
|
||
|
use Engelsystem\Models\User\State;
|
||
|
use Engelsystem\Models\User\User;
|
||
|
use Engelsystem\Models\Worklog;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class FactoriesTest extends TestCase
|
||
|
{
|
||
|
use HasDatabase;
|
||
|
|
||
|
/** @var string[] */
|
||
|
protected $models = [
|
||
|
User::class,
|
||
|
Contact::class,
|
||
|
PersonalData::class,
|
||
|
Settings::class,
|
||
|
State::class,
|
||
|
PasswordReset::class,
|
||
|
Worklog::class,
|
||
|
News::class,
|
||
|
NewsComment::class,
|
||
|
Message::class,
|
||
|
Faq::class,
|
||
|
Question::class,
|
||
|
Room::class,
|
||
|
Schedule::class,
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* Test all existing model factories
|
||
|
*/
|
||
|
public function testFactories()
|
||
|
{
|
||
|
$this->initDatabase();
|
||
|
|
||
|
foreach ($this->models as $model) {
|
||
|
$instance = (new $model())->factory()->create();
|
||
|
$this->assertInstanceOf(Model::class, $instance);
|
||
|
}
|
||
|
}
|
||
|
}
|