public function testBackClickPayPalToGC() { $options = $this->getDonorTestData('US'); $options['payment_method'] = 'paypal'; $options['ffname'] = 'paypal'; $paypalRequest = $this->setUpRequest($options); $gateway = new TestingPaypalLegacyAdapter(); $gateway->do_transaction('Donate'); $paymentForms = $paypalRequest->getSessionData('PaymentForms'); //check to see that we have a numAttempt and form set in the session $this->assertEquals('paypal', $paymentForms[0], "Paypal didn't load its form."); $this->assertEquals('1', $paypalRequest->getSessionData('numAttempt'), "We failed to record the initial paypal attempt in the session"); //now, get GC. $options['payment_method'] = 'cc'; unset($options['ffname']); $this->setUpRequest($options, $paypalRequest->getSessionArray()); $gateway = new TestingGlobalCollectAdapter(); $response = $gateway->do_transaction('INSERT_ORDERWITHPAYMENT'); $this->assertEmpty($response->getErrors()); $errors = ''; if (array_key_exists(LogLevel::ERROR, $this->testLogger->messages)) { foreach ($this->testLogger->messages[LogLevel::ERROR] as $msg) { $errors .= "{$msg}\n"; } } $this->assertEmpty($errors, "The gateway error log had the following message(s):\n" . $errors); }