private function executeQuery($query) { $query = $this->buildQuery($query); $content = $this->httpAdapter->get($query)->getContents(); $json = json_decode($content); $results = $json; return $results; }
/** * testGeocodingWillReturnAnArray */ public function testGeocodingWillReturnAnArray() { $responseMock = $this->prophesize(StreamInterface::class); $responseMock->getContents()->willReturn('[ { "foo": "bar" }, { "123": 456 } ]'); $this->httpAdapterMock->get(Argument::type('string'))->willReturn($responseMock->reveal()); $googleMapsGeoCoder = new GoogleMaps($this->httpAdapterMock->reveal(), false, 'xoxo'); $results = $googleMapsGeoCoder->geocode('Schützenstraße 8, 10117 Berlin, Deutschland'); $this->assertInternalType('array', $results); }