diff --git a/src/CastsEnums.php b/src/CastsEnums.php index 42ddcbc..2765032 100644 --- a/src/CastsEnums.php +++ b/src/CastsEnums.php @@ -1,4 +1,6 @@ enums[$key]; if (strpos($result, '@')) { - $class = Str::before($result, '@'); + $class = Str::before($result, '@'); $method = Str::after($result, '@'); // If no namespace was set, prepend the Model's namespace to the diff --git a/src/Commands/EnumMakeCommand.php b/src/Commands/EnumMakeCommand.php index 309f19a..aac7c2e 100644 --- a/src/Commands/EnumMakeCommand.php +++ b/src/Commands/EnumMakeCommand.php @@ -1,5 +1,7 @@ AddressType::SHIPPING, + 'type' => AddressType::SHIPPING, 'address' => 'Richard Avenue 33' ]); @@ -39,7 +41,7 @@ public function it_resolves_fqcn_enum_class_name_from_the_at_notation() public function it_resolves_local_enum_class_name_from_the_at_notation() { $address = Address::create([ - 'type' => AddressType::SHIPPING, + 'type' => AddressType::SHIPPING, 'address' => 'Richard Avenue 33' ]); @@ -62,7 +64,7 @@ public function at_notation_does_not_collide_if_class_name_is_in_nampespace() public function it_keeps_original_namespace_with_at_notation_when_using_short_classnames_in_extended_classes() { $address = ExtendedAddress::create([ - 'type' => AddressType::BILLING, + 'type' => AddressType::BILLING, 'address' => 'Alexander Platz 1.' ]); diff --git a/tests/EnumAccessorTest.php b/tests/EnumAccessorTest.php index e6f4964..c6ff479 100644 --- a/tests/EnumAccessorTest.php +++ b/tests/EnumAccessorTest.php @@ -1,4 +1,6 @@ 'KH8FRWAD', - 'status' => OrderStatus::PROCESSING, + 'number' => 'KH8FRWAD', + 'status' => OrderStatus::PROCESSING, 'is_active' => 1 ]); @@ -129,8 +131,8 @@ public function it_doesnt_break_related_properties() $client = Client::create(['name' => 'Britney Spears']); $order = Order::create([ - 'number' => 'LDYG4G4', - 'status' => OrderStatus::PROCESSING, + 'number' => 'LDYG4G4', + 'status' => OrderStatus::PROCESSING, 'client_id' => $client->id ]); diff --git a/tests/EnumMutatorTest.php b/tests/EnumMutatorTest.php index 9fa2327..cc75fc4 100644 --- a/tests/EnumMutatorTest.php +++ b/tests/EnumMutatorTest.php @@ -1,4 +1,6 @@ expectException(\UnexpectedValueException::class); - $order = new Order(); + $order = new Order(); $order->status = 'wtf'; } } diff --git a/tests/EnumToArrayTest.php b/tests/EnumToArrayTest.php index 9dce1ca..8f20af7 100644 --- a/tests/EnumToArrayTest.php +++ b/tests/EnumToArrayTest.php @@ -1,4 +1,6 @@ attributesToArray(); - $array = $order->toArray(); + $array = $order->toArray(); $this->assertEquals($array, $attributesArray); } diff --git a/tests/Models/Address.php b/tests/Models/Address.php index dd60170..39a8578 100644 --- a/tests/Models/Address.php +++ b/tests/Models/Address.php @@ -1,4 +1,6 @@ 'Konekt\\Enum\\Eloquent\\Tests\\Resolvers\\AddressTypeResolver@enumClass', + 'type' => 'Konekt\\Enum\\Eloquent\\Tests\\Resolvers\\AddressTypeResolver@enumClass', 'status' => 'AddressStatusResolver@enumClass' ]; } diff --git a/tests/Models/AddressStatus.php b/tests/Models/AddressStatus.php index a13d1da..4684e42 100644 --- a/tests/Models/AddressStatus.php +++ b/tests/Models/AddressStatus.php @@ -1,4 +1,6 @@ capsule = new Capsule(); $this->capsule->addConnection([ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => ':memory:', ]);