/** * Can we set and get IDs. Is the interface fluent? */ public function testId() { $obj_doc = new \Search\Document(); $obj_doc2 = $obj_doc->setId('121gw'); $this->assertEquals('121gw', $obj_doc->getId()); $this->assertSame($obj_doc, $obj_doc2); }
/** * Test the delete document function with a variety of inputs */ public function testDeleteMulti() { $str_index = 'test-index'; $str_id = '123456789'; $obj_request = new \google\appengine\DeleteDocumentRequest(); $obj_params = $obj_request->mutableParams(); $obj_params->mutableIndexSpec()->setName($str_index); $obj_params->addDocId($str_id); $this->apiProxyMock->expectCall('search', 'DeleteDocument', $obj_request, new \google\appengine\DeleteDocumentResponse()); $obj_index = new \Search\Index($str_index); $obj_index->delete($str_id); $this->apiProxyMock->verify(); $this->apiProxyMock->expectCall('search', 'DeleteDocument', $obj_request, new \google\appengine\DeleteDocumentResponse()); $obj_doc = new \Search\Document(); $obj_doc->setId($str_id); $obj_index->delete($obj_doc); $this->apiProxyMock->verify(); $this->apiProxyMock->expectCall('search', 'DeleteDocument', $obj_request, new \google\appengine\DeleteDocumentResponse()); $obj_doc = new \Search\Document(); $obj_doc->setId($str_id); $obj_index->delete([$obj_doc]); $this->apiProxyMock->verify(); }