/** * Pass */ public function testPass() { $this->pass->setWebServiceURL('http://example.com')->setForegroundColor('rgb(0, 255, 0)')->setBackgroundColor('rgb(0, 255, 0)')->setLabelColor('rgb(0, 255, 0)')->setAuthenticationToken('123')->setType('generic')->setSuppressStripShine(false)->setAppLaunchURL('http://app.launch.url')->addAssociatedStoreIdentifier(123); $properties = array('webServiceURL', 'foregroundColor', 'backgroundColor', 'labelColor', 'authenticationToken', 'suppressStripShine', 'associatedStoreIdentifiers', 'appLaunchURL'); $array = $this->pass->toArray(); foreach ($properties as $property) { $this->assertTrue(isset($array[$property])); } }
public function testWebServiceAuthenticationToken() { $this->assertPasses($this->pass, PassValidator::WEB_SERVICE_URL_INVALID); $this->assertPasses($this->pass, PassValidator::WEB_SERVICE_AUTHENTICATION_TOKEN_INVALID); $this->pass->setWebServiceURL(''); $this->assertFails($this->pass, PassValidator::WEB_SERVICE_URL_INVALID); $this->pass->setWebServiceURL('https://example.com'); $this->assertFails($this->pass, PassValidator::WEB_SERVICE_AUTHENTICATION_TOKEN_REQUIRED); $this->pass->setAuthenticationToken('1234567890abcde'); $this->assertFails($this->pass, PassValidator::WEB_SERVICE_AUTHENTICATION_TOKEN_INVALID); }