Skip to content

Commit

Permalink
Merge pull request #9958 from seamuslee001/CRM-20023
Browse files Browse the repository at this point in the history
CRM-20023 Add test showing passing in just state_province_id and coun…
  • Loading branch information
totten authored Mar 9, 2017
2 parents 2482b1d + 61e0e28 commit 9a9258a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/phpunit/CRM/Utils/GeocodeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Class CRM_Utils_GeocodeTest
* @group headless
*/
class CRM_Utils_GeocodeTest extends CiviUnitTestCase {

public function setUp() {
parent::setUp();
}

public function tearDown() {
parent::tearDown();
}

public function testStateProvinceFormat() {
$params = array('state_province_id' => 1022, 'country' => 'U.S.A');
$formatted = CRM_Utils_Geocode_Google::format($params);
$this->assertTrue($formatted);
$this->assertApproxEquals('46.72', $params['geo_code_1'], 1);
$this->assertApproxEquals('-94.68', $params['geo_code_2'], 1);
}

}

0 comments on commit 9a9258a

Please sign in to comment.