Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PaginationProcessorTest.php
Go to the documentation of this file.
1 <?php
7 
11 
12 class PaginationProcessorTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testProcess()
15  {
17 
19  $searchCriteriaMock = $this->getMockBuilder(SearchCriteriaInterface::class)
20  ->getMock();
21  $searchCriteriaMock->expects($this->once())
22  ->method('getCurrentPage')
23  ->willReturn(22);
24  $searchCriteriaMock->expects($this->once())
25  ->method('getPageSize')
26  ->willReturn(33);
27 
29  $collectionMock = $this->getMockBuilder(AbstractDb::class)
30  ->disableOriginalConstructor()
31  ->getMock();
32  $collectionMock->expects($this->once())
33  ->method('setCurPage')
34  ->with(22)
35  ->willReturnSelf();
36  $collectionMock->expects($this->once())
37  ->method('setPageSize')
38  ->with(33)
39  ->willReturnSelf();
40 
41  $model->process($searchCriteriaMock, $collectionMock);
42  }
43 }