diff --git a/tests/Factories/Factory.php b/tests/Factories/Factory.php new file mode 100644 index 0000000..d169166 --- /dev/null +++ b/tests/Factories/Factory.php @@ -0,0 +1,55 @@ + $attributes + * @return array + */ + protected static function attributes(array $attributes = []): array + { + return array_merge(static::definition(), $attributes); + } + + /** + * Atributos por defecto de la fábrica. + * + * @return array + */ + abstract protected static function definition(): array; + + /** + * Crea una instancia del modelo con los atributos dados. + * + * @param array $attributes + */ + abstract public static function create(array $attributes = []): object; +}