Skip to content

Commit ac8804d

Browse files
committed
Fix test
1 parent 759f042 commit ac8804d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/ActiveDataProvider.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ public function getQueryResults()
5353
return $this->_queryResults;
5454
}
5555

56+
/**
57+
* @inheritdoc
58+
*/
59+
public function prepare($forcePrepare = false)
60+
{
61+
if ($forcePrepare) {
62+
$this->setTotalCount(null);
63+
}
64+
parent::prepare($forcePrepare);
65+
}
66+
5667
/**
5768
* @return array all aggregations results
5869
*/

tests/ActiveDataProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testTotalCountAfterSearch()
158158
$query->andWhere(['name' => 'user2']);
159159
$provider->prepare(true);
160160
$this->assertCount(1, $provider->getModels());
161-
$this->assertEquals(1, $provider->getPagination()->getPageCount());
161+
$this->assertEquals(1, $pagination->getPageCount());
162162
$this->assertEquals(1, $provider->getTotalCount());
163163
}
164164
}

0 commit comments

Comments
 (0)