public function testSaveNumResults()
 {
     /** @var \Magento\Search\Model\Query|\PHPUnit_Framework_MockObject_MockObject $model */
     $model = $this->getMockBuilder('Magento\\Search\\Model\\Query')->disableOriginalConstructor()->getMock();
     $model->expects($this->any())->method('getStoreId')->willReturn(1);
     $model->expects($this->any())->method('getQueryText')->willReturn('queryText');
     $model->expects($this->any())->method('getNumResults')->willReturn(30);
     $this->adapter->expects($this->once())->method('insertOnDuplicate');
     $this->model->saveNumResults($model);
 }
Exemple #2
0
 public function testSaveIncrementalPopularity()
 {
     $this->resource->expects($this->once())->method('saveIncrementalPopularity')->with($this->model);
     $result = $this->model->saveIncrementalPopularity();
     $this->assertEquals($this->model, $result);
 }