generated from stancl/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Livewire-namespaced traits. Resolve #1
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Lean\LivewireAccess\Tests; | ||
|
||
use Lean\LivewireAccess\WithExplicitAccess; | ||
use Lean\LivewireAccess\FrontendAccess; | ||
use Livewire\Component; | ||
use Livewire\WithPagination; | ||
|
||
class PaginatedComponent extends Component | ||
{ | ||
use WithExplicitAccess, WithPagination; | ||
|
||
public string $foo = 'foo'; | ||
|
||
#[FrontendAccess] | ||
public string $bar = 'bar'; | ||
|
||
public function abc() {} | ||
|
||
#[FrontendAccess] | ||
public function def() {} | ||
|
||
public function render() | ||
{ | ||
return ''; | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Lean\LivewireAccess\Tests; | ||
|
||
use Livewire\Livewire; | ||
|
||
class PaginationTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function livewire_trait_methods_are_supported() | ||
{ | ||
Livewire::test(PaginatedComponent::class) | ||
->call('gotoPage', 2); | ||
} | ||
|
||
/** @test */ | ||
public function livewire_trait_properties_are_supported() | ||
{ | ||
Livewire::test(PaginatedComponent::class) | ||
->call('$set', 'page', 3); | ||
} | ||
} |