Skip to content

Commit d15defc

Browse files
author
Stanislav Idolov
authored
ENGCOM-3258: Cover \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\Collection class with Integration test #18771
2 parents 92e3572 + 31c460d commit d15defc

File tree

1 file changed

+44
-0
lines changed
  • dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/ResourceModel/Grid

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CheckoutAgreements\Model\ResourceModel\Grid;
9+
10+
use Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\Collection;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
13+
/**
14+
* Check data in collection
15+
*/
16+
class CollectionTest extends \PHPUnit\Framework\TestCase
17+
{
18+
/**
19+
* @var Collection;
20+
*/
21+
private $collection;
22+
23+
/**
24+
* @inheritdoc
25+
*/
26+
public function setUp()
27+
{
28+
$this->collection = Bootstrap::getObjectManager()
29+
->create(Collection::class);
30+
}
31+
32+
/**
33+
* Check that collection is filterable by store
34+
*
35+
* @magentoDataFixture Magento/CheckoutAgreements/_files/multi_agreements_active_with_text.php
36+
*/
37+
public function testAddStoresToFilter(): void
38+
{
39+
$collectionSize = $this->collection->addStoreFilter(1)
40+
->load(false, false)
41+
->getSize();
42+
$this->assertEquals(2, $collectionSize);
43+
}
44+
}

0 commit comments

Comments
 (0)