Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreFilterTest.php
Go to the documentation of this file.
1 <?php
8 
9 use PHPUnit\Framework\TestCase;
11 
12 class StoreFilterTest extends TestCase
13 {
17  private $model;
18 
19  protected function setUp()
20  {
21  $this->model = new StoreFilter();
22  }
23 
24  public function testApply()
25  {
26  $filterMock = $this->createMock(\Magento\Framework\Api\Filter::class);
27  $filterMock->expects($this->once())->method('getValue')->willReturn(1);
28  $collectionMock = $this->createMock(
29  \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Collection::class
30  );
31  $collectionMock->expects($this->once())->method('addStoreFilter')->with(1)->willReturnSelf();
32  $this->assertTrue($this->model->apply($filterMock, $collectionMock));
33  }
34 }