Skip to content

Commit

Permalink
Fixed array test for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Nov 3, 2020
1 parent 0ec0982 commit 5153245
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/EnumToArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Konekt\Enum\Eloquent\Tests;

use Konekt\Enum\Eloquent\Tests\Models\Order;
use Konekt\Enum\Eloquent\Tests\Models\OrderStatusV2;
use Konekt\Enum\Eloquent\Tests\Models\OrderV2;
use Konekt\Enum\Eloquent\Tests\Models\OrderStatus;

Expand Down Expand Up @@ -113,14 +114,15 @@ public function returns_enum_v2_default_string_value_when_attribute_is_null()
}

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

$array = $order->attributesToArray();

$this->assertArrayHasKey('status', $array);
$this->assertIsString($array['status']);
$this->assertEquals($array['status'], OrderStatus::__DEFAULT);
$this->assertEquals($array['status'], OrderStatusV2::__default);
}

private function getEnumVersion()
Expand Down

0 comments on commit 5153245

Please sign in to comment.