Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RequestInfoFilterTest.php
Go to the documentation of this file.
1 <?php
7 
11 class RequestInfoFilterTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $model;
17 
21  protected $objectManager;
22 
26  protected function setUp()
27  {
28  $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
29 
30  $this->model = $this->objectManager->getObject(
31  \Magento\Checkout\Model\Cart\RequestInfoFilter::class,
32  [
33  'filterList' => ['efg', 'xyz'],
34  ]
35  );
36  }
37 
41  public function testFilter()
42  {
44  $params = $this->objectManager->getObject(
45  \Magento\Framework\DataObject::class,
46  ['data' => ['abc' => 1, 'efg' => 1, 'xyz' => 1]]
47  );
48  $result = $this->model->filter($params);
49  $this->assertEquals($this->model, $result);
50  $this->assertEquals(['abc' => 1], $params->convertToArray());
51  }
52 }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18