Initial commit
This commit is contained in:
16
skills/make-story/templates/Story/AppStory.php
Normal file
16
skills/make-story/templates/Story/AppStory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Story;
|
||||
|
||||
use App\Contracts\Story\StoryInterface;
|
||||
use Zenstruck\Foundry\Attribute\AsFixture;
|
||||
use Zenstruck\Foundry\Story;
|
||||
|
||||
#[AsFixture(name: 'main')]
|
||||
final class AppStory extends Story implements StoryInterface
|
||||
{
|
||||
public function build(): void
|
||||
{
|
||||
UtilisateurStory::load();
|
||||
}
|
||||
}
|
||||
26
skills/make-story/templates/Story/UtilisateurStory.php
Normal file
26
skills/make-story/templates/Story/UtilisateurStory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Story;
|
||||
|
||||
use App\Contracts\Story\StoryInterface;
|
||||
use App\Factory\UtilisateurFactory;
|
||||
use Zenstruck\Foundry\Story;
|
||||
|
||||
final class UtilisateurStory extends Story implements StoryInterface
|
||||
{
|
||||
public function build(): void
|
||||
{
|
||||
// Utilisateur par défaut
|
||||
UtilisateurFactory::createOne();
|
||||
|
||||
// Utilisateurs avec IDs spécifiques pour les tests
|
||||
UtilisateurFactory::new()
|
||||
->withSpecificId('01234567-89ab-cdef-0123-456789abcdef')
|
||||
->create();
|
||||
|
||||
// Créer plusieurs utilisateurs
|
||||
UtilisateurFactory::createMany(10);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user