PATH:
opt
/
alt
/
tests
/
alt-php56-pecl-solr_2.4.0-1.el8
/
tests
--TEST-- SolrUtils::digestJsonResponse() - Digest JSON Response --FILE-- <?php $responseString = ' { "responseHeader":{ "status":0, "QTime":1, "params":{ "indent":"on", "wt":"json", "q":"lucene", "version":"2.2"}}, "response":{"numFound":1,"start":0,"docs":[ { "id":"SOLR1000", "name":"Solr, the Enterprise Search Server", "manu":"Apache Software Foundation", "cat":["software", "search"], "features":["Advanced Full-Text Search Capabilities using Lucene", "Optimized for High Volume Web Traffic", "Standards Based Open Interfaces - XML and HTTP", "Comprehensive HTML Administration Interfaces", "Scalability - Efficient Replication to other Solr Search Servers", "Flexible and Adaptable with XML configuration and Schema", "Good unicode support: hello (hello with an accent over the e)"], "price":0.0, "price_c":"0,USD", "popularity":10, "inStock":true, "incubationdate_dt":"2006-01-17T00:00:00Z", "_version_":1460602453694087168}] }}'; if (!json_decode($responseString)) { echo "PHP JSON DECODE failed with: ". json_last_error_msg().PHP_EOL; } $response = SolrUtils::digestJsonResponse($responseString); var_dump($response instanceof SolrObject); var_dump($response); var_dump($response->response->docs[0]->_version_ == 1460602453694087168); ?> --EXPECTF-- bool(true) object(SolrObject)#%d (2) { ["responseHeader"]=> object(SolrObject)#4 (3) { ["status"]=> int(0) ["QTime"]=> int(1) ["params"]=> object(SolrObject)#5 (4) { ["indent"]=> string(2) "on" ["wt"]=> string(4) "json" ["q"]=> string(6) "lucene" ["version"]=> string(3) "2.2" } } ["response"]=> object(SolrObject)#%d (3) { ["numFound"]=> int(1) ["start"]=> int(0) ["docs"]=> array(1) { [0]=> object(SolrObject)#%d (11) { ["id"]=> string(8) "SOLR1000" ["name"]=> string(34) "Solr, the Enterprise Search Server" ["manu"]=> string(26) "Apache Software Foundation" ["cat"]=> array(2) { [0]=> string(8) "software" [1]=> string(6) "search" } ["features"]=> array(7) { [0]=> string(51) "Advanced Full-Text Search Capabilities using Lucene" [1]=> string(37) "Optimized for High Volume Web Traffic" [2]=> string(46) "Standards Based Open Interfaces - XML and HTTP" [3]=> string(44) "Comprehensive HTML Administration Interfaces" [4]=> string(64) "Scalability - Efficient Replication to other Solr Search Servers" [5]=> string(56) "Flexible and Adaptable with XML configuration and Schema" [6]=> string(61) "Good unicode support: hello (hello with an accent over the e)" } ["price"]=> float(0) ["price_c"]=> string(5) "0,USD" ["popularity"]=> int(10) ["inStock"]=> bool(true) ["incubationdate_dt"]=> string(20) "2006-01-17T00:00:00Z" ["_version_"]=> %s } } } } bool(true)
[+]
..
[-] 055.solrinputdocument_serialization.phpt
[edit]
[-] 064.solrquery_StatsComponent.phpt
[edit]
[-] 014.solrclient_addDocument_nested_document.phpt
[edit]
[-] 007.solrclient_deleteByIds.phpt
[edit]
[-] 000.solr_server_compat.phpt
[edit]
[-] 062.solrquery_date_facet_parameters.phpt
[edit]
[-] 103.solrresponse_get_array_response.phpt
[edit]
[-] 105.solrresponse_child_doc_response.phpt
[edit]
[-] 041.solrobject_illegal_operation.phpt
[edit]
[-] 065.solrquery_MoreLikeThis.phpt
[edit]
[-] 115.solrdismaxquery_userfields.phpt
[edit]
[-] test.config.inc
[edit]
[-] 111.solrdismaxquery_boostquery.phpt
[edit]
[-] 091.solrserverexception_json.phpt
[edit]
[-] 012.solrclient_getById.phpt
[edit]
[-] 052.solrinputdocument_haschilddocuments.phpt
[edit]
[-] 046.solrobject_getpropertynames.phpt
[edit]
[-] 001.solrclient_addDocument.phpt
[edit]
[-] 040.solrobject_xmlresponse.phpt
[edit]
[-] 113.solrdismaxquery_bigramfields.phpt
[edit]
[-] 106.solrresponse_child_doc_response_solrdoc.phpt
[edit]
[-] 080.solrutils_escapequerychars.phpt
[edit]
[-] 006.solrclient_system.phpt
[edit]
[-] 011.solrclient_phps_response.phpt
[edit]
[-] 024.solrdocument_child_fetch.phpt
[edit]
[-] 009.solrclient_optimize.phpt
[edit]
[+]
files
[-] 043.solrobject_magic_properties.phpt
[edit]
[-] 101.solrresponse_parseMode.phpt
[edit]
[-] bug_61836_error.phpt
[edit]
[-] 044.solrobject_dimension_access_properties.phpt
[edit]
[-] 020.solrdocument_adding_fields.phpt
[edit]
[-] 104.solrresponse_get_response_maxscore.phpt
[edit]
[-] 000.solrclient_ping.phpt
[edit]
[-] bootstrap.inc
[edit]
[-] 092.solrserverexception_php.phpt
[edit]
[-] 071.solrquery_collapse_exception.phpt
[edit]
[-] 022.solrdocument_getInputDocument.phpt
[edit]
[-] skip.if.server_not_configured.inc
[edit]
[-] bug_68181.phpt
[edit]
[-] 045.solrobject_array_access.phpt
[edit]
[-] 054.solrinputdocument_addchilddocuments.phpt
[edit]
[-] 050.solrinputdocument_addchilddocument_01.phpt
[edit]
[-] 063.solrquery_HighlightingParameters.phpt
[edit]
[-] 069.solrquery_GroupParameters.phpt
[edit]
[-] bug_59511_error.phpt
[edit]
[-] bug_70482.phpt
[edit]
[-] 026.solrdocument_getchilddocscount.phpt
[edit]
[-] 021.solrdocument_iterator.phpt
[edit]
[-] 151.solrcollapsefunction_illegal_operations.phpt
[edit]
[-] 015.solrclient_addDocuments_nested_document.phpt
[edit]
[-] 130.parameters_simple_list_separator.phpt
[edit]
[-] 050.solrinputdocument_addchilddocument_02_error.phpt
[edit]
[-] 010.solrclient_getOptions.phpt
[edit]
[-] 004.solrclient_query_response.phpt
[edit]
[-] 090.solrserverexception_xml.phpt
[edit]
[-] 051.solrinputdocument_getchilddocuments.phpt
[edit]
[-] 114.solrdismaxquery_trigramfields.phpt
[edit]
[-] 003.solrclient_addDocument_no_overwrite.phpt
[edit]
[-] bug_70496.phpt
[edit]
[-] bug_69156.phpt
[edit]
[-] 150.solrcollapsefunction.phpt
[edit]
[-] bug_68179.phpt
[edit]
[-] 100.solrresponse_json.phpt
[edit]
[-] 008.solrclient_commit.phpt
[edit]
[-] 025.solrdocument_haschilddocuments.phpt
[edit]
[-] 053.solrinputdocument_getchilddocumentscount.phpt
[edit]
[-] 061.solrquery_simpleFacetParameters.phpt
[edit]
[-] 023.solrdocument_merge_no_overwrite.phpt
[edit]
[-] 067.solrquery__construct.phpt
[edit]
[-] 160.solr_update_document_block.phpt
[edit]
[-] 023.solrdocument_merge.phpt
[edit]
[-] 013.solrclient_getByIds.phpt
[edit]
[-] 116.solrdismaxquery_boostfunction.phpt
[edit]
[-] 042.solrobject_magic_property.phpt
[edit]
[-] 110.solrdismaxquery.phpt
[edit]
[-] 112.solrdismaxquery_query_parser.phpt
[edit]
[-] 027.solrdocument_getinputdocument_children.phpt
[edit]
[-] 070.solrquery_collapse.phpt
[edit]
[-] 066.solrquery_TermsComponent.phpt
[edit]
[-] bug_70495.phpt
[edit]
[-] 081.solrutils_digest_json_response.phpt
[edit]
[-] 002.solrclient_addDocuments.phpt
[edit]
[-] 068.solrquery_parameters_error.phpt
[edit]
[-] 102.solrresponse_phps.phpt
[edit]
[-] 072.solrquery_expand.phpt
[edit]
[-] 005.solrclient_query_error.phpt
[edit]
[-] 060.solrquery_comon_query_params.phpt
[edit]