mirror of
https://github.com/archtechx/livewire-access.git
synced 2025-12-12 04:14:03 +00:00
Support Livewire-namespaced traits. Resolve #1
This commit is contained in:
parent
2cc9881905
commit
0e45cfdc6e
3 changed files with 66 additions and 2 deletions
28
tests/PaginatedComponent.php
Normal file
28
tests/PaginatedComponent.php
Normal file
|
|
@ -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 '';
|
||||
}
|
||||
}
|
||||
22
tests/PaginationTest.php
Normal file
22
tests/PaginationTest.php
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue