Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Sep 29, 2024
1 parent 3ea9ef0 commit df0d2f6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/Column/DataColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Yiisoft\Yii\DataView\Tests\Column;

use PHPUnit\Framework\TestCase;
use Yiisoft\Data\Reader\Iterable\IterableDataReader;
use Yiisoft\Definitions\Exception\CircularReferenceException;
use Yiisoft\Definitions\Exception\InvalidConfigException;
use Yiisoft\Definitions\Exception\NotInstantiableException;
Expand Down Expand Up @@ -499,19 +500,22 @@ public function testColumnClasses(): void
{
Assert::equalsWithoutLE(
<<<HTML
<div id="w1-grid">
<div>
<table>
<colgroup>
<col class="columnClassAttr columnClass" custom="columnAttributes">
</colgroup>
<thead>
<tr>
<th class="headerClass" custom="headerAttributes">Name</th>
<th class="headerClassAttr headerClass" custom="headerAttributes">Name</th>
</tr>
</thead>
<tbody>
<tr>
<td class="bodyClass" custom="bodyAttributes">John</td>
<td class="bodyClassAttr bodyClass" custom="bodyAttributes">John</td>
</tr>
<tr>
<td class="bodyClass" custom="bodyAttributes">Mary</td>
<td class="bodyClassAttr bodyClass" custom="bodyAttributes">Mary</td>
</tr>
</tbody>
</table>
Expand All @@ -524,20 +528,23 @@ public function testColumnClasses(): void
'name',
columnAttributes: [
'custom' => 'columnAttributes',
'class' => 'columnClassAttr',
],
headerAttributes: [
'custom' => 'headerAttributes',
'class' => 'headerClassAttr',
],
bodyAttributes: [
'custom' => 'bodyAttributes',
'class' => ['bodyClassAttr'],
],
columnClass: 'columnClass',
headerClass: 'headerClass',
bodyClass: 'bodyClass'
),
)
->id('w1-grid')
->dataReader($this->createOffsetPaginator($this->data, 10))
->columnGroupEnabled()
->dataReader(new IterableDataReader($this->data))
->render()
);
}
Expand Down

0 comments on commit df0d2f6

Please sign in to comment.