Skip to content

Commit

Permalink
fix: mismatched key casing (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmccreary authored Mar 4, 2020
1 parent 94cb062 commit 02cbbd2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Generators/FactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ public static function fakerDataType(string $type)
'enum' => 'randomElement(/** enum_attributes **/)',
];

return $fakeableTypes[$type] ?? null;
return $fakeableTypes[strtolower($type)] ?? null;
}
}
1 change: 1 addition & 0 deletions tests/fixtures/definitions/post.bp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ models:
Post:
title: string
author_id: id
author_bio: longtext
content: bigtext nullable
published_at: timestamp nullable
word_count: integer unsigned
1 change: 1 addition & 0 deletions tests/fixtures/factories/post-configured.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
return [
'title' => $faker->sentence(4),
'author_id' => factory(\Some\App\Models\Author::class),
'author_bio' => $faker->text,
'content' => $faker->paragraphs(3, true),
'published_at' => $faker->dateTime(),
'word_count' => $faker->randomNumber(),
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/factories/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
return [
'title' => $faker->sentence(4),
'author_id' => factory(\App\Author::class),
'author_bio' => $faker->text,
'content' => $faker->paragraphs(3, true),
'published_at' => $faker->dateTime(),
'word_count' => $faker->randomNumber(),
Expand Down

0 comments on commit 02cbbd2

Please sign in to comment.