/**
  * Invalid signature should be recognized as such.
  */
 function testInvalidSignature()
 {
     $init = $this->getDonorTestData('BR');
     $session['Donor']['order_id'] = '123456789';
     $this->setUpRequest($init, $session);
     $gateway = new TestingAstroPayAdapter();
     $gateway->setDummyGatewayResponseCode('badsig');
     $gateway->do_transaction('PaymentStatus');
     $results = $gateway->getTransactionData();
     $this->setExpectedException('ResponseProcessingException');
     $gateway->verifyStatusSignature($results);
 }
 public function testResetSubmethodOnMethodSwitch()
 {
     // Donor thinks they want to make a bank transfer, submits form
     $init = $this->getDonorTestData('BR');
     $init['payment_method'] = 'bt';
     $init['payment_submethod'] = 'itau';
     $firstRequest = $this->setUpRequest($init);
     $gateway = new TestingAstroPayAdapter();
     $gateway->do_transaction('Donate');
     $donorData = $firstRequest->getSessionData('Donor');
     $this->assertEquals('itau', $donorData['payment_submethod'], 'Test setup failed.');
     // Then they go back and decide they want to donate via credit card
     $init['payment_method'] = 'cc';
     unset($init['payment_submethod']);
     $secondRequest = $this->setUpRequest($init, $firstRequest->getSessionArray());
     $gateway = new TestingAstroPayAdapter();
     $newMethod = $gateway->getData_Unstaged_Escaped('payment_method');
     $newSubmethod = $gateway->getData_Unstaged_Escaped('payment_submethod');
     $this->assertEquals('cc', $newMethod, 'Test setup failed');
     $this->assertEquals('', $newSubmethod, 'Submethod was not blanked on method switch');
 }