public function testPassLocation() { $this->assertPasses($this->pass, PassValidator::LOCATION_LONGITUDE_REQUIRED); $this->assertPasses($this->pass, PassValidator::LOCATION_LATITUDE_REQUIRED); $this->assertPasses($this->pass, PassValidator::LOCATION_ALTITUDE_INVALID); $location = new Location(0, 0); $this->pass->addLocation($location); $this->assertPasses($this->pass, PassValidator::LOCATION_LONGITUDE_REQUIRED); $this->assertPasses($this->pass, PassValidator::LOCATION_LATITUDE_REQUIRED); $this->assertPasses($this->pass, PassValidator::LOCATION_ALTITUDE_INVALID); $location->setLatitude(null); $this->assertFails($this->pass, PassValidator::LOCATION_LATITUDE_REQUIRED); $location->setLatitude(''); $this->assertFails($this->pass, PassValidator::LOCATION_LATITUDE_REQUIRED); $location->setLatitude('foo'); $this->assertFails($this->pass, PassValidator::LOCATION_LATITUDE_INVALID); $location->setLatitude(0); $location->setLongitude(null); $this->assertFails($this->pass, PassValidator::LOCATION_LONGITUDE_REQUIRED); $location->setLongitude(''); $this->assertFails($this->pass, PassValidator::LOCATION_LONGITUDE_REQUIRED); $location->setLongitude('foo'); $this->assertFails($this->pass, PassValidator::LOCATION_LONGITUDE_INVALID); $location->setLongitude(0); $location->setAltitude(0); $this->assertPasses($this->pass, PassValidator::LOCATION_ALTITUDE_INVALID); $location->setAltitude(''); $this->assertFails($this->pass, PassValidator::LOCATION_ALTITUDE_INVALID); $location->setAltitude('foo'); $this->assertFails($this->pass, PassValidator::LOCATION_ALTITUDE_INVALID); }
$obj->boardingPass_addFlightInfo("Flight #", "390"); $obj->boardingPass_addClassInfo("Class", "Economy"); $obj->boardingPass_addFlightDate("Date", "04/19"); $obj->boardingPass_addPessangerInfo("Name", "John"); $obj->addIcon("/var/www/passimages/icon.png"); $obj->addIconHD("/var/www/passimages/icon@2x.png"); $obj->addLogo("/var/www/passimages/logo.png"); $obj->addLogoHD("/var/www/passimages/logo@2x.png"); $obj->addBackScreenInfo("Copyrights", "All rights reserved"); if ($obj->generatePass("/var/www/passbook/test/", "BoardingPass")) { echo "<br> Your Pass has been generated. Now sign the pass by using following <a href='https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Introduction.html'>link</a>"; } // Create COUPON pass $obj2 = new ApplePass(COUPON, "YOUR PASS IDENTIFIER", "YOUR TEAM IDENTIFIER", "Super General Store", "Super General Store Coupon", "Super Store", "rgb(22, 55, 110)", "rgb(50, 91, 185)"); $obj2->addBarCode("SGSC00145UP"); $obj2->addLocation("27.43903", "69.4532322"); $obj2->addLocation("88.85342", "33.7540967"); $obj2->couponPass_addHeaderInfo("No", "6901"); $obj2->couponPass_addDesc("on all mobile phones", "5% Off"); $obj2->couponPass_addInfo("Expiry:", "04/26/2014"); $obj2->couponPass_addInfo("Member:", "John"); $obj->addIcon("/var/www/images/coupon/icon.png"); $obj2->addIconHD("/var/www/images/coupon/icon@2x.png"); $obj2->addLogo("/var/www/images/coupon/logo.png"); $obj2->addLogoHD("/var/www/images/coupon/logo@2x.png"); $obj2->addBackScreenInfo("Copyrights", "All rights reserved Super General Store"); if ($obj2->generatePass("/var/www/passbook/test/", "CouponPass")) { echo "<br> Your Pass has been generated. Now sign the pass by using following <a href='https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Introduction.html'>link</a>"; } // Create Event ticket pass $obj3 = new ApplePass(EVENT_TICKET, "YOUR PASS IDENTIFIER", "YOUR TEAM IDENTIFIER", "ABC Entertainment", "Summer Gala", "ABC Entertainment", "rgb(22, 55, 110)", "rgb(50, 91, 185)");