Skip to content

Commit 02cbbd2

Browse files
fix: mismatched key casing (#70)
1 parent 94cb062 commit 02cbbd2

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

src/Generators/FactoryGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,6 @@ public static function fakerDataType(string $type)
173173
'enum' => 'randomElement(/** enum_attributes **/)',
174174
];
175175

176-
return $fakeableTypes[$type] ?? null;
176+
return $fakeableTypes[strtolower($type)] ?? null;
177177
}
178178
}

tests/fixtures/definitions/post.bp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ models:
22
Post:
33
title: string
44
author_id: id
5+
author_bio: longtext
56
content: bigtext nullable
67
published_at: timestamp nullable
78
word_count: integer unsigned

tests/fixtures/factories/post-configured.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
return [
1010
'title' => $faker->sentence(4),
1111
'author_id' => factory(\Some\App\Models\Author::class),
12+
'author_bio' => $faker->text,
1213
'content' => $faker->paragraphs(3, true),
1314
'published_at' => $faker->dateTime(),
1415
'word_count' => $faker->randomNumber(),

tests/fixtures/factories/post.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
return [
1010
'title' => $faker->sentence(4),
1111
'author_id' => factory(\App\Author::class),
12+
'author_bio' => $faker->text,
1213
'content' => $faker->paragraphs(3, true),
1314
'published_at' => $faker->dateTime(),
1415
'word_count' => $faker->randomNumber(),

0 commit comments

Comments
 (0)