public function test_simple() { $hash_in = array('id' => 'id', 'orderId' => '1', 'amount' => '2', 'orderSource' => 'ecommerce', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213')); $initialize = new LitleOnlineRequest(); $response = $initialize->activate($hash_in); $message = XmlParser::getAttribute($response, 'litleOnlineResponse', 'message'); $this->assertEquals('Valid Format', $message); }
public function test_simple() { $hash_in = array('orderId' => '1', 'amount' => '2', 'orderSource' => 'ECOMMERCE', 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213')); $mock = $this->getMock('litle\\sdk\\LitleXmlMapper'); $mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<orderId>1.*<amount>2.*<orderSource>ECOMMERCE.*<card.*type.*VI.*/')); $litleTest = new LitleOnlineRequest(); $litleTest->newXML = $mock; $litleTest->activate($hash_in); }
/** * Make an activate API request. * * This method wraps the LitleOnlineRequest. * * @param array $hash_in * The request data. * * @return DOMDocument|SimpleXMLElement * The response. */ public function activate($hash_in) { return $this->request->activate($hash_in); }