Skip to content

Commit 4327325

Browse files
committed
Merge branch 'MAGETWO-91520' into 2.3-develop-pr8
2 parents 356ad60 + 2d922b0 commit 4327325

File tree

2 files changed

+33
-4
lines changed
  • app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned
  • dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned

2 files changed

+33
-4
lines changed

app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/Grid.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public function __construct(
3737
}
3838

3939
/**
40+
* Grid constructor
41+
*
4042
* @return void
4143
*/
4244
protected function _construct()
@@ -46,6 +48,8 @@ protected function _construct()
4648
}
4749

4850
/**
51+
* Prepare collection
52+
*
4953
* @return \Magento\Backend\Block\Widget\Grid
5054
*/
5155
protected function _prepareCollection()
@@ -67,11 +71,16 @@ protected function _prepareCollection()
6771

6872
$this->setCollection($collection);
6973
parent::_prepareCollection();
74+
if ($this->_isExport) {
75+
$collection->setPageSize(null);
76+
}
7077
$this->getCollection()->resolveCustomerNames();
7178
return $this;
7279
}
7380

7481
/**
82+
* Add column filter to collection
83+
*
7584
* @param array $column
7685
*
7786
* @return $this
@@ -90,6 +99,8 @@ protected function _addColumnFilterToCollection($column)
9099
}
91100

92101
/**
102+
* Prepare columns
103+
*
93104
* @return \Magento\Backend\Block\Widget\Grid\Extended
94105
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
95106
*/
@@ -223,6 +234,8 @@ protected function _prepareColumns()
223234
}
224235

225236
/**
237+
* Get rows url
238+
*
226239
* @param \Magento\Framework\DataObject $row
227240
*
228241
* @return string

dev/tests/integration/testsuite/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/GridTest.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Reports\Block\Adminhtml\Shopcart\Abandoned;
79

810
use Magento\Quote\Model\Quote;
911
use Magento\TestFramework\Helper\Bootstrap;
12+
use Magento\Framework\View\LayoutInterface;
1013

1114
/**
1215
* Test class for \Magento\Reports\Block\Adminhtml\Shopcart\Abandoned\Grid
@@ -20,12 +23,12 @@ class GridTest extends \Magento\Reports\Block\Adminhtml\Shopcart\GridTestAbstrac
2023
/**
2124
* @return void
2225
*/
23-
public function testGridContent()
26+
public function testGridContent(): void
2427
{
25-
/** @var \Magento\Framework\View\LayoutInterface $layout */
26-
$layout = Bootstrap::getObjectManager()->get(\Magento\Framework\View\LayoutInterface::class);
28+
/** @var LayoutInterface $layout */
29+
$layout = Bootstrap::getObjectManager()->get(LayoutInterface::class);
2730
/** @var Grid $grid */
28-
$grid = $layout->createBlock(\Magento\Reports\Block\Adminhtml\Shopcart\Abandoned\Grid::class);
31+
$grid = $layout->createBlock(Grid::class);
2932
$grid->getRequest()->setParams(['filter' => base64_encode(urlencode('email=customer@example.com'))]);
3033
$result = $grid->getPreparedCollection();
3134

@@ -35,4 +38,17 @@ public function testGridContent()
3538
$this->assertEquals('customer@example.com', $quote->getCustomerEmail());
3639
$this->assertEquals(10.00, $quote->getSubtotal());
3740
}
41+
42+
/**
43+
* @return void
44+
*/
45+
public function testPageSizeIsSetToNullWhenExportCsvFile(): void
46+
{
47+
/** @var LayoutInterface $layout */
48+
$layout = Bootstrap::getObjectManager()->get(LayoutInterface::class);
49+
/** @var Grid $grid */
50+
$grid = $layout->createBlock(Grid::class);
51+
$grid->getCsvFile();
52+
$this->assertNull($grid->getCollection()->getPageSize());
53+
}
3854
}

0 commit comments

Comments
 (0)