Example #1
0
 /**
  * @test
  */
 public function deleteCheckResultAndCheckThatAllParamsPassedCorrectly()
 {
     $expectedIndexId = __LINE__;
     $expectedQueryCriteria = '>';
     $expectedQuery = array($expectedQueryCriteria => 100500);
     $expectedLimit = array(mt_rand(1, 100500), mt_rand(1, 100500));
     $expectedFilter = array('testFilter1', 'testFilter2');
     $expectedInKey = 'testKey' . __LINE__;
     $expectedIn = array($expectedInKey => 'testValue');
     $expectedOptions = array('filter' => $expectedFilter, 'in' => $expectedIn);
     $expectedResult = __LINE__;
     $this->_writeDriverMock->executeDeleteResult = $expectedResult;
     $result = $this->_adapter->delete($expectedIndexId, $expectedQuery, $expectedLimit, $expectedOptions);
     $this->assertEquals($expectedResult, $result);
     $this->assertEquals($expectedIndexId, $this->_writeDriverMock->lastCallParams[0]);
     $this->assertEquals($expectedQueryCriteria, $this->_writeDriverMock->lastCallParams[1]);
     $this->assertEquals($expectedQuery[$expectedQueryCriteria], $this->_writeDriverMock->lastCallParams[2]);
     $this->assertEquals($expectedLimit[0], $this->_writeDriverMock->lastCallParams[3]);
     $this->assertEquals($expectedLimit[1], $this->_writeDriverMock->lastCallParams[4]);
     $this->assertEquals($expectedFilter, $this->_writeDriverMock->lastCallParams[5]);
     $this->assertEquals($expectedInKey, $this->_writeDriverMock->lastCallParams[6]);
     $this->assertEquals($expectedIn[$expectedInKey], $this->_writeDriverMock->lastCallParams[7]);
 }