From 57d4a970748babae541ba92bbcc2a1e7f0043f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20A=2E=20L=C3=B3pez=20L=C3=B3pez?= Date: Sat, 7 Sep 2024 01:56:48 -0400 Subject: [PATCH] #14: add tests for the new methods controlling the ListView's items wrapper element. --- tests/ListView/BaseTest.php | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/ListView/BaseTest.php b/tests/ListView/BaseTest.php index 21feea006..7c869df83 100644 --- a/tests/ListView/BaseTest.php +++ b/tests/ListView/BaseTest.php @@ -267,4 +267,52 @@ public function testKeysetPaginationConfig(): void ->render(), ); } + + public function testChangeItemsWrapperTag(): void + { + Assert::equalsWithoutLE( + << +
    +
  1. +
    Id: 1
    Name: John
    Age: 20
    +
  2. +
  3. +
    Id: 2
    Name: Mary
    Age: 21
    +
  4. +
+
Page 1 of 1
+ + HTML, + ListView::widget() + ->itemsWrapperTag('ol') + ->itemView(dirname(__DIR__) . '/Support/view/_listview.php') + ->dataReader($this->createOffsetPaginator($this->data, 10)) + ->render(), + ); + } + + public function testChangeItemsWrapperTagAttributes(): void + { + Assert::equalsWithoutLE( + << + +
Page 1 of 1
+ + HTML, + ListView::widget() + ->itemsWrapperAttributes(['class' => 'the-item-wrapper-class']) + ->itemView(dirname(__DIR__) . '/Support/view/_listview.php') + ->dataReader($this->createOffsetPaginator($this->data, 10)) + ->render(), + ); + } }