public function test_simple()
 {
     $hash_in = array('planCode' => '1', 'name' => '2', 'intervalType' => 'MONTHLY', 'amount' => '1000');
     $initialize = new LitleOnlineRequest();
     $createPlanResponse = $initialize->createPlan($hash_in);
     $message = XmlParser::getAttribute($createPlanResponse, 'litleOnlineResponse', 'message');
     $this->assertEquals('Valid Format', $message);
 }
 public function test_ActiveIsOptional()
 {
     $hash_in = array('planCode' => '1', 'name' => '2', 'id' => 'id', 'intervalType' => 'MONTHLY', 'amount' => '1000', 'numberOfPayments' => '5', 'trialNumberOfIntervals' => '6', 'trialIntervalType' => 'WEEKLY');
     $mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
     $mock->expects($this->once())->method('request')->with($this->logicalNot($this->matchesRegularExpression('/.*active.*/')));
     $litleTest = new LitleOnlineRequest();
     $litleTest->newXML = $mock;
     $litleTest->createPlan($hash_in);
 }
 /**
  * Make a createPlan API request.
  *
  * This method wraps the LitleOnlineRequest.
  *
  * @param array $hash_in
  *   The request data.
  *
  * @return DOMDocument|SimpleXMLElement
  *   The response.
  */
 public function createPlan($hash_in)
 {
     return $this->request->createPlan($hash_in);
 }