Skip to content

Commit

Permalink
fix: styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelfrisch committed Sep 27, 2024
1 parent c46005a commit 2a5bd25
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3147,8 +3147,8 @@ public function testModelToJsonSucceedsWithPriorErrors(): void
public function testFillableWithMutators()
{
$model = new EloquentModelWithMutators;
$model->fillable(['fullname', 'full_address']);
$model->fill(['id' => 1, 'fullname' => 'John Doe', 'full_address' => '123 Main Street, Anytown']);
$model->fillable(['full_name', 'full_address']);
$model->fill(['id' => 1, 'full_name' => 'John Doe', 'full_address' => '123 Main Street, Anytown']);

$this->assertNull($model->id);
$this->assertSame('John', $model->first_name);
Expand All @@ -3161,7 +3161,7 @@ public function testGuardedWithMutators()
{
$model = new EloquentModelWithMutators;
$model->guard(['id']);
$model->fill(['id' => 1, 'fullname' => 'John Doe', 'full_address' => '123 Main Street, Anytown']);
$model->fill(['id' => 1, 'full_name' => 'John Doe', 'full_address' => '123 Main Street, Anytown']);

$this->assertNull($model->id);
$this->assertSame('John', $model->first_name);
Expand Down Expand Up @@ -3906,12 +3906,12 @@ class EloquentModelWithMutators extends Model
'address_line_two' => null,
];

protected function fullname(): Attribute
protected function fullName(): Attribute
{
return Attribute::make(
get: fn (mixed $value, array $attributes) => $attributes['first_name'] . ' ' . $attributes['last_name'],
get: fn (mixed $value, array $attributes) => $attributes['first_name'].' '.$attributes['last_name'],
set: function (string $fullName) {
[$firstName, $lastName] = explode(" ", $fullName);
[$firstName, $lastName] = explode(' ', $fullName);

return [
'first_name' => $firstName,
Expand Down

0 comments on commit 2a5bd25

Please sign in to comment.