setCredentialObject() public method

Sets credential object for users
public setCredentialObject ( OAuthTokenCredential $credential, string | null $userId = null, boolean $default = true )
$credential PayPal\Auth\OAuthTokenCredential
$userId string | null User Id associated with the account
$default boolean If set, it would make it as a default credential for all requests
 /**
  * @after testGetDefaultCredentialObject
  *
  * @throws \PayPal\Exception\PayPalInvalidCredentialException
  */
 public function testSetCredentialObjectWithoutDefault()
 {
     $authObject = $this->getMockBuilder('\\Paypal\\Auth\\OAuthTokenCredential')->disableOriginalConstructor()->getMock();
     $cred = $this->object->setCredentialObject($authObject, null, false)->getCredentialObject();
     $this->assertNotNull($cred);
     $this->assertNotSame($this->object->getCredentialObject(), $authObject);
 }