mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-21 11:27:47 +00:00
Create a simple test to play with foundry - problem with test db remaining
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Factory\Embeddable;
|
||||
|
||||
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
|
||||
use Zenstruck\Foundry\ModelFactory;
|
||||
use Zenstruck\Foundry\Proxy;
|
||||
|
||||
/**
|
||||
* @extends ModelFactory<PrivateCommentEmbeddable>
|
||||
*
|
||||
* @method PrivateCommentEmbeddable|Proxy create(array|callable $attributes = [])
|
||||
* @method static PrivateCommentEmbeddable|Proxy createOne(array $attributes = [])
|
||||
* @method static PrivateCommentEmbeddable[]|Proxy[] createMany(int $number, array|callable $attributes = [])
|
||||
* @method static PrivateCommentEmbeddable[]|Proxy[] createSequence(iterable|callable $sequence)
|
||||
*
|
||||
* @phpstan-method Proxy<PrivateCommentEmbeddable> create(array|callable $attributes = [])
|
||||
* @phpstan-method static Proxy<PrivateCommentEmbeddable> createOne(array $attributes = [])
|
||||
*/
|
||||
final class PrivateCommentEmbeddableFactory extends ModelFactory
|
||||
{
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
|
||||
*
|
||||
* @todo inject services if required
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
|
||||
*
|
||||
* @todo add your default values here
|
||||
*/
|
||||
protected function getDefaults(): array
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
||||
*/
|
||||
protected function initialize(): self
|
||||
{
|
||||
return $this
|
||||
->withoutPersisting()
|
||||
// ->afterInstantiate(function(PrivateCommentEmbeddable $privateCommentEmbeddable): void {})
|
||||
;
|
||||
}
|
||||
|
||||
protected static function getClass(): string
|
||||
{
|
||||
return PrivateCommentEmbeddable::class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user