Skip to content

Commit 3cba00c

Browse files
committed
Cover \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\Collection class with Integration test
1 parent c515b40 commit 3cba00c

File tree

1 file changed

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

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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()->create(Collection::class);
29+
}
30+
31+
/**
32+
* Check that collection is filterable by store
33+
*
34+
* @magentoDataFixture Magento/CheckoutAgreements/_files/multi_agreements_active_with_text.php
35+
*/
36+
public function testAddStoresToFilter(): void
37+
{
38+
$collectionSize = $this->collection->addStoreFilter(1)->load(false, false)->getSize();
39+
$this->assertEquals(2, $collectionSize);
40+
}
41+
}

0 commit comments

Comments
 (0)