/** * @covers Paradox\Client::createGeoIndex */ public function testCreateGeo2Index() { $id = $this->client->createGeoIndex($this->collectionName, array('lat', 'long'), false, true, true); $info = $this->client->getIndexInfo($this->collectionName, $id); $this->assertInternalType('array', $info, "The index we just created is missing"); $this->assertEquals("geo2", $info['type'], 'The type of the created index should be "geo2"'); $this->assertEquals('lat', $info['fields'][0], "The first field of the created index does not match"); $this->assertEquals('long', $info['fields'][1], "The second field of the created index does not match"); $this->assertArrayNotHasKey('geoJson', $info, 'The geoJson of the created index should be "false"'); $this->assertTrue($info['constraint'], 'The constraint of the create index should be "true"'); $this->assertTrue($info['ignoreNull'], 'The ignoreNull of the created index should be "true"'); }