Пример #1
0
 /**
  * Initializes the class
  *
  * @param SimpleXMLIterator $operation
  */
 public function __construct(SimpleXMLIterator $operation)
 {
     if (!isset($operation->authentication)) {
         throw new IntacctException('Authentication block is missing from operation element');
     }
     $this->setAuthentication($operation->authentication);
     if ($this->authentication->getStatus() !== 'success') {
         $errors = [];
         if (isset($operation->errormessage)) {
             $errorMessage = new ErrorMessage($operation->errormessage);
             $errors = $errorMessage->getErrors();
         }
         throw new OperationException('Response authentication status failure', $errors);
     }
     if (!isset($operation->result[0])) {
         throw new IntacctException('Result block is missing from operation element');
     }
     foreach ($operation->result as $result) {
         $this->setResult($result);
     }
 }
 /**
  * @covers Intacct\Xml\Response\Operation\Authentication::getSlideInUser
  */
 public function testGetSlideInUserDirectLogin()
 {
     $this->assertEquals(false, $this->object->getSlideInUser());
 }