X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2FCRM%2FCore%2FBAO%2FOpenIDTest.php;h=1d0886b5c4615af613339129257fd4030350a4c9;hb=f76980beca30b2cd48350576ab3e7a8f1284fb06;hp=3531bc82934ecb097c55e888503edfb5e25d48b7;hpb=07490253d0a765a705fdd9ac9ac40df59933cbb8;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Core/BAO/OpenIDTest.php b/tests/phpunit/CRM/Core/BAO/OpenIDTest.php index 3531bc8293..1d0886b5c4 100644 --- a/tests/phpunit/CRM/Core/BAO/OpenIDTest.php +++ b/tests/phpunit/CRM/Core/BAO/OpenIDTest.php @@ -1,12 +1,11 @@ individualCreate(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); $openIdURL = "http://test-username.civicrm.org/"; - $params = array( + $params = [ 'contact_id' => $contactId, 'location_type_id' => 1, 'openid' => $openIdURL, 'is_primary' => 1, - ); + ]; $openObject = CRM_Core_BAO_OpenID::add($params); @@ -44,13 +43,13 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { // Now call add() to modify an existing open-id record - $params = array( + $params = [ 'id' => $openId, 'contact_id' => $contactId, 'openid' => $openIdURL, 'is_bulkmail' => 1, 'allowed_to_login' => 1, - ); + ]; CRM_Core_BAO_OpenID::add($params); @@ -67,16 +66,16 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { * IfAllowedToLogin() method (set and reset allowed_to_login) */ public function testIfAllowedToLogin() { - $contactId = Contact::createIndividual(); + $contactId = $this->individualCreate(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); $openIdURL = "http://test-username.civicrm.org/"; - $params = array( + $params = [ 'contact_id' => $contactId, 'location_type_id' => 1, 'openid' => $openIdURL, 'is_primary' => 1, - ); + ]; $openObject = CRM_Core_BAO_OpenID::add($params); @@ -90,13 +89,13 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { // Now call add() to modify an existing open-id record - $params = array( + $params = [ 'id' => $openId, 'contact_id' => $contactId, 'openid' => $openIdURL, 'is_bulkmail' => 1, 'allowed_to_login' => 1, - ); + ]; CRM_Core_BAO_OpenID::add($params); @@ -112,18 +111,18 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { * AllOpenIDs() method - get all OpenIDs for the given contact */ public function testAllOpenIDs() { - $contactId = Contact::createIndividual(); + $contactId = $this->individualCreate(); $this->assertDBRowExist('CRM_Contact_DAO_Contact', $contactId); // create first openid $openIdURLOne = "http://test-one-username.civicrm.org/"; - $params = array( + $params = [ 'contact_id' => $contactId, 'location_type_id' => 1, 'openid' => $openIdURLOne, 'is_primary' => 1, 'allowed_to_login' => 1, - ); + ]; $openObjectOne = CRM_Core_BAO_OpenID::add($params); @@ -134,11 +133,11 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase { // create second openid $openIdURLTwo = "http://test-two-username.civicrm.org/"; - $params = array( + $params = [ 'contact_id' => $contactId, 'location_type_id' => 1, 'openid' => $openIdURLTwo, - ); + ]; $openObjectTwo = CRM_Core_BAO_OpenID::add($params); $openIdTwo = $openObjectTwo->id;