Skip to content
This repository
Browse code

fixed init in case of disabled pagination

  • Loading branch information...
commit 09bbf001fda4c8e8120eec5c0d864ffede6d0d7f 1 parent 2e016dc
Anton Yakushin antonCPU authored
2  framework/web/CDataProviderIterator.php
@@ -51,7 +51,7 @@ public function __construct(CDataProvider $dataProvider, $pageSize=null)
51 51 $this->_totalItemCount=$dataProvider->getTotalItemCount();
52 52
53 53 if(($pagination=$this->_dataProvider->getPagination())===false)
54   - $this->_dataProvider->setPagination(new CPagination());
  54 + $this->_dataProvider->setPagination($pagination=new CPagination());
55 55
56 56 if($pageSize!==null)
57 57 $pagination->setPageSize($pageSize);
11 tests/framework/web/CDataProviderIteratorTest.php
@@ -41,6 +41,17 @@ public function testIterator($pageSize)
41 41 }
42 42
43 43 /**
  44 + * @dataProvider pageSizes
  45 + */
  46 + public function testInitWithDisabledPagination($pageSizes)
  47 + {
  48 + $dataProvider = new CArrayDataProvider($this->generateData(10), array(
  49 + 'pagination' => false,
  50 + ));
  51 + new CDataProviderIterator($dataProvider, $pageSizes);
  52 + }
  53 +
  54 + /**
44 55 * Generates some data to fill a dataProvider
45 56 * @param integer $totalItems the total number of items to generate
46 57 * @return array the data

0 comments on commit 09bbf00

Please sign in to comment.
Something went wrong with that request. Please try again.