-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from macbookandrew/feature/livewire-wirable
add optional wirable support to enums
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Spatie\Enum\Laravel\Tests; | ||
|
||
use Spatie\Enum\Laravel\Tests\Extra\StatusEnum; | ||
|
||
final class WireableTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_be_cast_to_and_from_livewire() | ||
{ | ||
$enum = StatusEnum::draft(); | ||
|
||
$castEnum = StatusEnum::fromLivewire($enum->toLivewire()); | ||
|
||
$this->assertTrue($castEnum->equals($enum)); | ||
} | ||
} |