Skip to content

Commit

Permalink
Reverted all the functional changes from yesterday to see if it the p…
Browse files Browse the repository at this point in the history
…ipeline with Composer 2 passes
  • Loading branch information
fulopattila122 committed Nov 4, 2020
1 parent 6931990 commit 3b8cb7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/CastsEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ protected function addEnumAttributesToArray(array $attributes): array
{
foreach ($this->enums as $key => $value) {
// Don't set if the field is not present (pluck or not selecting them in the SQL can cause it)
if (isset($this->attributes[$key])) {
//if (isset($this->attributes[$key])) {
$attributes[$key] = $this->getAttributeValue($key)->value();
}
//}
}

return $attributes;
Expand Down
24 changes: 12 additions & 12 deletions tests/EnumToArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function returns_enum_default_string_value_when_attribute_is_null()

$order = new Order([
'number' => 'abc123',
'status' => null
//'status' => null
]);

$array = $order->attributesToArray();
Expand All @@ -90,16 +90,16 @@ public function returns_enum_default_string_value_when_attribute_is_null()
$this->assertEquals($array['status'], OrderStatus::__DEFAULT);
}

/** @test */
public function it_does_not_set_the_attribute_key_if_the_attribute_is_absent_in_the_model()
{
$order = new Order([
'number' => 'abc123'
]);

$array = $order->attributesToArray();
$this->assertArrayNotHasKey('status', $array);
}
// /** @test */
// public function it_does_not_set_the_attribute_key_if_the_attribute_is_absent_in_the_model()
// {
// $order = new Order([
// 'number' => 'abc123'
// ]);
//
// $array = $order->attributesToArray();
// $this->assertArrayNotHasKey('status', $array);
// }

/**
* @test
Expand All @@ -115,7 +115,7 @@ public function returns_enum_v2_default_string_value_when_attribute_is_null()

$order = new OrderV2([
'number' => 'abc123',
'status' => null
//'status' => null
]);

$array = $order->attributesToArray();
Expand Down

0 comments on commit 3b8cb7d

Please sign in to comment.