|
3 | 3 | namespace Rappasoft\LaravelLivewireTables\Tests\Http\Livewire; |
4 | 4 |
|
5 | 5 | use Rappasoft\LaravelLivewireTables\DataTableComponent; |
| 6 | +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\Traits\TestHelpers; |
6 | 7 |
|
7 | 8 | abstract class BaseTable extends DataTableComponent |
8 | 9 | { |
9 | | - public string $paginationTest = 'standard'; |
10 | | - |
11 | | - public function enableDetailedPagination(string $type = 'standard') |
12 | | - { |
13 | | - $this->setPerPageAccepted([1, 3, 5, 10, 15, 25, 50])->setPerPage(3); |
14 | | - $this->setPaginationMethod($type); |
15 | | - $this->setDisplayPaginationDetailsEnabled(); |
16 | | - |
17 | | - } |
18 | | - |
19 | | - public function disableDetailedPagination(string $type = 'standard') |
20 | | - { |
21 | | - $this->setPerPageAccepted([1, 3, 5, 10, 15, 25, 50])->setPerPage(3); |
22 | | - $this->setPaginationMethod($type); |
23 | | - $this->setDisplayPaginationDetailsDisabled(); |
24 | | - } |
25 | | - |
26 | | - public function setPaginationTest(string $type) |
27 | | - { |
28 | | - $this->paginationTest = $type; |
29 | | - } |
| 10 | + use TestHelpers; |
30 | 11 |
|
31 | | - public function bootAll() |
32 | | - { |
33 | | - $view = view('livewire-tables::datatable'); |
34 | | - |
35 | | - $this->boot(); |
36 | | - $this->bootedComponentUtilities(); |
37 | | - $this->bootedManagesFilters(); |
38 | | - $this->bootedWithColumns(); |
39 | | - $this->bootedWithColumnSelect(); |
40 | | - $this->booted(); |
41 | | - $this->mountManagesFilters(); |
42 | | - $this->mountComponentUtilities(); |
43 | | - $this->mountWithSorting(); |
44 | | - $this->renderAll($view); |
45 | | - } |
46 | | - |
47 | | - public function renderAll($view = null) |
48 | | - { |
49 | | - if (is_null($view)) { |
50 | | - $view = view('livewire-tables::datatable'); |
51 | | - } |
52 | | - $this->renderingWithColumns($view, $view->getData()); |
53 | | - $this->renderingWithColumnSelect($view, $view->getData()); |
54 | | - $this->renderingWithCustomisations($view, $view->getData()); |
55 | | - $this->renderingWithData($view, $view->getData()); |
56 | | - $this->renderingWithReordering($view, $view->getData()); |
57 | | - $this->renderingWithPagination($view, $view->getData()); |
58 | | - $this->render(); |
59 | | - |
60 | | - return $view; |
61 | | - } |
| 12 | + public string $paginationTest = 'standard'; |
62 | 13 | } |
0 commit comments