test level based scheduling
This commit is contained in:
parent
99e1ba051c
commit
a64df64b76
7 changed files with 415 additions and 94 deletions
|
|
@ -6,6 +6,7 @@ use App\Auth\PasswordHasher;
|
|||
use App\Element\Element;
|
||||
use App\Element\ElementRepository;
|
||||
use App\Set\SetRepository;
|
||||
use App\Set\SetLevelRepository;
|
||||
use App\Shared\ValueObject\EmailAddress;
|
||||
use App\User\UserRepository;
|
||||
use Database\Seeders\UserSeeder;
|
||||
|
|
@ -70,6 +71,12 @@ class DatabaseSeederTest extends TestCase
|
|||
|
||||
$sets = app(SetRepository::class)->all();
|
||||
$elementRepository = app(ElementRepository::class);
|
||||
$setLevelRepository = app(SetLevelRepository::class);
|
||||
$expectedLevels = [
|
||||
'Bible' => ['book', 'portion', 'chapter'],
|
||||
'Course' => ['module', 'lesson'],
|
||||
'Fitness Program' => ['phase', 'workout', 'exercise'],
|
||||
];
|
||||
$expectedElements = [
|
||||
'Bible' => [
|
||||
'Chapter 1:chapter:Creation',
|
||||
|
|
@ -100,9 +107,16 @@ class DatabaseSeederTest extends TestCase
|
|||
],
|
||||
];
|
||||
|
||||
$this->assertDatabaseCount('set_levels', 8);
|
||||
$this->assertDatabaseCount('elements', 21);
|
||||
|
||||
foreach ($sets as $set) {
|
||||
$this->assertSame(
|
||||
$expectedLevels[$set->getName()],
|
||||
array_map(function ($level): string {
|
||||
return $level->getKind();
|
||||
}, $setLevelRepository->findBySet($set)),
|
||||
);
|
||||
$signatures = array_map(function (Element $element): string {
|
||||
$parentName = $element->getParentElement()?->getName()
|
||||
?? 'root';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue