-
-
Notifications
You must be signed in to change notification settings - Fork 119
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 #165 from renoki-co/fix/strict-mode-in-models
[3.x] Fix the strict mode in models
- Loading branch information
Showing
14 changed files
with
174 additions
and
9 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
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
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,41 @@ | ||
<?php | ||
|
||
namespace Rennokki\QueryCache\Test; | ||
|
||
use Illuminate\Support\Facades\Cache; | ||
use Livewire\Component; | ||
use Livewire\Livewire; | ||
use Rennokki\QueryCache\Test\Models\Post; | ||
|
||
class LivewireTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider strictModeContextProvider | ||
*/ | ||
public function test_livewire_component_poll_doesnt_break_when_callback_is_already_set() | ||
{ | ||
// See: https://github.com/renoki-co/laravel-eloquent-query-cache/issues/163 | ||
Livewire::component(PostComponent::class); | ||
|
||
$posts = factory(Post::class, 30)->create(); | ||
|
||
/** @var \Livewire\Testing\TestableLivewire $component */ | ||
Livewire::test(PostComponent::class, ['post' => $posts->first()]) | ||
->assertOk() | ||
->assertSee($posts[0]->name) | ||
->pretendWereSendingAComponentUpdateRequest( | ||
'callMethod', | ||
['id' => 'grwk', 'method' => '$refresh', 'params' => []], | ||
); | ||
} | ||
} | ||
|
||
class PostComponent extends Component | ||
{ | ||
public Post $post; | ||
|
||
public static function getName() | ||
{ | ||
return 'post'; | ||
} | ||
} |
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
Oops, something went wrong.