mockWebApplication(); Yii::$app->getRequest()->setQueryParams([ 'page' => $page, ]); $column = new SerialColumn([ 'grid' => new GridView([ 'dataProvider' => new ArrayDataProvider($dataProviderConfig), ]), ]); $result = $column->renderDataCell(['id' => 1], 1, $index); $this->assertSame($expectedResult, $result); } public static function provideRenderDataCellData(): array { return [ [ [ 'pagination' => false, ], null, 0, '1', ], [ [ 'pagination' => false, ], null, 5, '6', ], [ [ 'pagination' => new Pagination(), ], null, 0, '1', ], [ [ 'pagination' => new Pagination(), ], null, 4, '5', ], [ [ 'pagination' => new Pagination([ 'totalCount' => 20, 'defaultPageSize' => 10, ]), ], '2', 0, '11', ], [ [ 'pagination' => new Pagination([ 'totalCount' => 20, 'defaultPageSize' => 10, ]), ], '2', 3, '14', ], ]; } }