Skip to content

Commit a06c93d

Browse files
committed
Add table id config test
1 parent dde6a9e commit a06c93d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
This package is a plugin of [Laravel DataTables](https://github.com/yajra/laravel-datatables) for generating dataTables script using PHP.
1111

1212
## Requirements
13+
1314
- [Laravel 5.4+](https://github.com/laravel/framework)
1415
- [Laravel DataTables v7.x|v8.x|9.x](https://github.com/yajra/laravel-datatables)
1516

1617
## Documentations
18+
1719
- [Laravel DataTables Documentation](http://yajrabox.com/docs/laravel-datatables)
1820
- [Demo Application](http://datatables.yajrabox.com) is available for artisan's reference.
1921

@@ -25,12 +27,15 @@ This package is a plugin of [Laravel DataTables](https://github.com/yajra/larave
2527
| 9.x | 5.x |
2628

2729
## Quick Installation
30+
2831
`composer require yajra/laravel-datatables-html:^5.0`
2932

3033
#### Service Provider (Optional on Laravel 5.5+)
34+
3135
`Yajra\DataTables\HtmlServiceProvider::class`
3236

3337
#### Publish Assets (Optional)
38+
3439
`$ php artisan vendor:publish --tag=datatables-html`
3540

3641
And that's it! Start building out some awesome DataTables!

src/Html/HasTable.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public function setTableId(string $id): static
4242
* Get HTML table "id" attribute.
4343
*
4444
* @return string
45-
* @throws \Exception
4645
*/
4746
public function getTableId(): string
4847
{

tests/HtmlBuilderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ public function it_can_resolved_builder_class()
1818
$this->assertInstanceOf(Builder::class, $builder);
1919
}
2020

21+
/** @test */
22+
public function it_can_read_table_id_from_config()
23+
{
24+
$this->assertEquals('dataTableBuilder', $this->getHtmlBuilder()->getTableId());
25+
26+
config()->set('datatables-html.table.id', 'test');
27+
28+
$this->assertEquals('test', $this->getHtmlBuilder()->getTableId());
29+
}
30+
2131
/** @test */
2232
public function it_can_generate_table_html_and_scripts()
2333
{

0 commit comments

Comments
 (0)