Skip to content

Cover \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\Collection class with Integration test #18771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\CheckoutAgreements\Model\ResourceModel\Grid;

use Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\Collection;
use Magento\TestFramework\Helper\Bootstrap;

/**
* Check data in collection
*/
class CollectionTest extends \PHPUnit\Framework\TestCase
{
/**
* @var Collection;
*/
private $collection;

/**
* @inheritdoc
*/
public function setUp()
{
$this->collection = Bootstrap::getObjectManager()
->create(Collection::class);
}

/**
* Check that collection is filterable by store
*
* @magentoDataFixture Magento/CheckoutAgreements/_files/multi_agreements_active_with_text.php
*/
public function testAddStoresToFilter(): void
{
$collectionSize = $this->collection->addStoreFilter(1)
->load(false, false)
->getSize();
$this->assertEquals(2, $collectionSize);
}
}