createOne(); static::assertIsString($group->getName()); } /** * Groups shall have subtitle. * * @return void */ public function testHasSubtitle(): void { $group = Group::factory()->createOne(); static::assertIsString($group->getSubtitle()); } /** * Group shall have a one-to-many relationship with the type Theme. * * @return void */ public function testThemes(): void { $themeCount = $this->faker->randomDigitNotNull(); $group = Group::factory() ->has(AnimeTheme::factory()->for(Anime::factory())->count($themeCount)) ->createOne(); static::assertInstanceOf(HasMany::class, $group->animethemes()); static::assertEquals($themeCount, $group->animethemes()->count()); static::assertInstanceOf(AnimeTheme::class, $group->animethemes()->first()); } }