Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSearchTermReportForm.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\CatalogSearch\Test\Page\Adminhtml\CatalogSearchEdit;
10 use Magento\Reports\Test\Page\Adminhtml\SearchIndex;
12 
18 {
29  public function processAssert(
30  CatalogSearchEdit $catalogSearchEdit,
31  SearchIndex $searchIndex,
32  $productName,
33  $countProducts,
34  $countSearch
35  ) {
36  $filter = [
37  'query_text' => $productName,
38  'num_results' => $countProducts,
39  'popularity' => $countSearch,
40  ];
41  $searchIndex->open();
42  $searchIndex->getSearchGrid()->searchAndOpen($filter);
43 
44  $dataDiff = $this->verifyData($filter, $catalogSearchEdit->getForm()->getData());
45 
46  \PHPUnit\Framework\Assert::assertEmpty($dataDiff, $dataDiff);
47  }
48 
54  public function toString()
55  {
56  return 'Search Term Report form data equals to passed from dataset.';
57  }
58 }
verifyData(array $fixtureData, array $formData, $isStrict=false, $isPrepareError=true)
processAssert(CatalogSearchEdit $catalogSearchEdit, SearchIndex $searchIndex, $productName, $countProducts, $countSearch)