public function test_closeRequest_badFile() { $batch_request = new BatchRequest($this->direct); $batch_request->transaction_file = "/usr/NOPERMS"; $this->setExpectedException('RuntimeException', 'Could not open transactions file at /usr/NOPERMS. Please check your privilege.'); $batch_request->closeRequest(); }
public function test_sendToLitle() { $request = new LitleRequest($this->config); $batch = new BatchRequest($this->direct); $sale_hash = array('orderId' => '1864', 'amount' => '10010', 'orderSource' => 'ecommerce', 'billToAddress' => array('name' => 'John Smith', 'addressLine1' => '1 Main St.', 'city' => 'Burlington', 'state' => 'MA', 'zip' => '01803-3747', 'country' => 'US'), 'card' => array('number' => '4457010000000009', 'expDate' => '0112', 'cardValidationNum' => '349', 'type' => 'VI'), 'reportGroup' => 'Planets'); $batch->addSale($sale_hash); $batch->closeRequest(); $request->addBatchRequest($batch); $request->closeRequest(); $response = $request->sendToLitle(); $this->assertTrue(file_exists($response)); $this->assertEquals($response, $request->response_file); $proc = new LitleResponseProcessor($response); $resp = $proc->nextTransaction(); $this->assertEquals('saleResponse', $resp->getName()); $this->assertEquals('Planets', $resp->attributes()->reportGroup); $this->assertEquals('1864', $resp->orderId); }