public function testApply()
 {
     $testId = 1;
     $mongoCursorMock = $this->getMockBuilder('\\MongoCursor')->disableOriginalConstructor()->getMock();
     $mongoCursorMock->expects($this->at(0))->method('limit')->with($this->equalTo(1))->will($this->returnValue($mongoCursorMock));
     $this->mongoCollectionMock->expects($this->at(0))->method('find')->with($this->equalTo(['_id' => $testId]))->will($this->returnValue($mongoCursorMock));
     $ar = new ActiveRecordCriteria();
     $ar->setId($testId);
     $res = $ar->apply($this->model);
     $this->assertEquals($mongoCursorMock, $res);
 }
 /**
  * {@inheritdoc}
  */
 public function apply(ModelStubInterface $model)
 {
     return $this->getDocumentStore()->initIsolationFromCursor($model->getDataGateway(), parent::apply($model));
 }