X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FCore%2FBAO%2FLocationTest.php;h=cdd71734da6d8085cc61f418dfe98846b1d4ac23;hb=481a74f476c945a324382bad34630d1a78d704c7;hp=355e680d6ecad45e7713584aaa86e93bb67f82f8;hpb=fe6a56117db7e9dada18e60f91de717a89013d86;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Core/BAO/LocationTest.php b/tests/phpunit/CRM/Core/BAO/LocationTest.php index 355e680d6e..cdd71734da 100644 --- a/tests/phpunit/CRM/Core/BAO/LocationTest.php +++ b/tests/phpunit/CRM/Core/BAO/LocationTest.php @@ -1,7 +1,7 @@ 'Location BAOs', - 'description' => 'Test all Core_BAO_Location methods.', - 'group' => 'CiviCRM BAO Tests', - ); - } - - function setUp() { + public function setUp() { parent::setUp(); - $this->quickCleanup( array( 'civicrm_contact', 'civicrm_address', 'civicrm_loc_block', 'civicrm_email', 'civicrm_phone', 'civicrm_im' ) ); + $this->quickCleanup(array('civicrm_contact', 'civicrm_address', 'civicrm_loc_block', 'civicrm_email', 'civicrm_phone', 'civicrm_im')); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * - * @access protected */ - function tearDown() { + public function tearDown() { $tablesToTruncate = array( 'civicrm_contact', 'civicrm_openid', @@ -73,7 +61,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { $this->quickCleanup($tablesToTruncate); } - function testCreateWithMissingParams() { + public function testCreateWithMissingParams() { $contactId = Contact::createIndividual(); $params = array( 'contact_id' => $contactId, @@ -96,7 +84,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * create various elements of location block * without civicrm_loc_block entry */ - function testCreateWithoutLocBlock() { + public function testCreateWithoutLocBlock() { $contactId = Contact::createIndividual(); //create various element of location block @@ -220,7 +208,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * create various elements of location block * with civicrm_loc_block */ - function testCreateWithLocBlock() { + public function testCreateWithLocBlock() { $this->_contactId = Contact::createIndividual(); //create test event record. $eventId = Event::create($this->_contactId); @@ -304,7 +292,8 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { ); //Now check DB for location elements. - $searchParams = array('id' => CRM_Utils_Array::value('address_id', $locElementIds), + $searchParams = array( + 'id' => CRM_Utils_Array::value('address_id', $locElementIds), 'location_type_id' => 1, 'is_primary' => 1, ); @@ -321,15 +310,16 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { ); $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams); - $searchParams = array('id' => CRM_Utils_Array::value('email_id', $locElementIds), + $searchParams = array( + 'id' => CRM_Utils_Array::value('email_id', $locElementIds), 'location_type_id' => 1, 'is_primary' => 1, ); $compareParams = array('email' => 'john.smith@example.org'); $this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams); - - $searchParams = array('id' => CRM_Utils_Array::value('phone_id', $locElementIds), + $searchParams = array( + 'id' => CRM_Utils_Array::value('phone_id', $locElementIds), 'location_type_id' => 1, 'is_primary' => 1, 'phone_type_id' => 1, @@ -337,14 +327,16 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { $compareParams = array('phone' => '303443689'); $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams); - $searchParams = array('id' => CRM_Utils_Array::value('phone_2_id', $locElementIds), + $searchParams = array( + 'id' => CRM_Utils_Array::value('phone_2_id', $locElementIds), 'location_type_id' => 1, 'phone_type_id' => 2, ); $compareParams = array('phone' => '9833910234'); $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams); - $searchParams = array('id' => CRM_Utils_Array::value('im_id', $locElementIds), + $searchParams = array( + 'id' => CRM_Utils_Array::value('im_id', $locElementIds), 'location_type_id' => 1, 'is_primary' => 1, ); @@ -368,7 +360,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * created with various elements. * */ - function testDeleteLocBlock() { + public function testDeleteLocBlock() { $this->_contactId = Contact::createIndividual(); //create test event record. $eventId = Event::create($this->_contactId); @@ -460,7 +452,7 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { * GetValues() method * get the values of various location elements */ - function testLocBlockgetValues() { + public function testLocBlockgetValues() { $contactId = Contact::createIndividual(); //create various element of location block @@ -560,4 +552,3 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { Contact::delete($contactId); } } -