/** * @param array $ticketsData * @return BuyResponse */ public static function create(array $ticketsDatas) { $buyResponse = new BuyResponse(); foreach ($ticketsDatas["_ticket"] as $ticketData) { $ticketData["_auth"] = $ticketsDatas["_auth"]; $buyResponse->append(TicketFactory::create($ticketData)); } return $buyResponse; }
/** * @expectedException InvalidArgumentException */ public function test_append_an_invalid_ticket_instance_should_rainse_an_exception() { $buyResponse = new BuyResponse(); $buyResponse->append(new \stdClass()); }