public function testThatCanDeleteObject()
 {
     $modelTransformer = new ModelToElasticaAutoTransformer();
     $typeMock = $this->getMockBuilder('Elastica_Type')->disableOriginalConstructor()->getMock();
     $typeMock->expects($this->once())->method('deleteById');
     $typeMock->expects($this->never())->method('addDocument');
     $fields = array('name');
     $objectPersister = new ObjectPersister($typeMock, $modelTransformer, 'SomeClass', $fields);
     $objectPersister->deleteOne(new POPO());
 }
 public function testThatCanDeleteObject()
 {
     $modelTransformer = new ModelToElasticaAutoTransformer();
     $typeMock = $this->getMockBuilder('Elastica_Type')->disableOriginalConstructor()->getMock();
     $typeMock->expects($this->once())->method('deleteById');
     $typeMock->expects($this->never())->method('addDocument');
     $mappingMock = $this->getMockBuilder('FOQ\\ElasticaBundle\\MappingRegistry')->disableOriginalConstructor()->getMock();
     $mappingMock->expects($this->any())->method('getTypeFieldNames')->will($this->returnValue(array('name')));
     $objectPersister = new ObjectPersister($typeMock, $modelTransformer, 'SomeClass', $mappingMock);
     $objectPersister->deleteOne(new POPO());
 }