Exemplo n.º 1
0
 /**
  * Tests the building of a ticket
  */
 public function testBuildTicket()
 {
     $data = json_decode($this->fixture, true);
     $ticket = TicketBuilder::buildTicket($data);
     $this->assertInstanceOf('Ideneal\\OpenLoad\\Entity\\Ticket', $ticket);
 }
Exemplo n.º 2
0
 /**
  * Returns the ticket to download a file
  *
  * @param string|FileInfo $file The file id
  *
  * @return Ticket
  */
 public function getTicket($file)
 {
     $params = ['file' => (string) $file];
     $response = $this->processRequest('file/dlticket', $params);
     $result = $this->processResponse($response);
     $ticket = TicketBuilder::buildTicket($result);
     $ticket->setFileId((string) $file);
     return $ticket;
 }