protected $_params;
protected $_ids = array();
protected $_pageParams = array();
+ protected $_userId;
/**
* Parameters to create payment processor.
public function setUp() {
$this->_apiversion = 3;
parent::setUp();
- $this->createLoggedInUser();
+ $this->_userId = $this->createLoggedInUser();
$this->_individualId = $this->individualCreate();
$this->_params = array(
$mut->stop();
}
+ /**
+ * Test the submit function on the contribution page using numerical from email address.
+ */
+ public function testSubmitEmailReceiptUserEmailFromAddress() {
+ $form = new CRM_Contribute_Form_Contribution();
+ $mut = new CiviMailUtils($this, TRUE);
+ $email = $this->callAPISuccess('Email', 'create', [
+ 'contact_id' => $this->_userId,
+ 'email' => 'testLoggedIn@example.com',
+ ]);
+ $form->testSubmit(array(
+ 'total_amount' => 50,
+ 'financial_type_id' => 1,
+ 'contact_id' => $this->_individualId,
+ 'is_email_receipt' => TRUE,
+ 'from_email_address' => $email['id'],
+ 'contribution_status_id' => 1,
+ ), CRM_Core_Action::ADD);
+ $this->callAPISuccessGetCount('Contribution', array('contact_id' => $this->_individualId), 1);
+ $mut->checkMailLog(array(
+ '<p>Please print this receipt for your records.</p>',
+ '<testloggedin@example.com>',
+ )
+ );
+ $mut->stop();
+ }
+
/**
* Ensure that price field are shown during pay later/pending Contribution
*/