예제 #1
0
 public function testPassWithoutOrganizationName()
 {
     $this->pass->setOrganizationName('');
     $this->assertFails($this->pass, PassValidator::ORGANIZATION_NAME_REQUIRED);
     $this->pass->setOrganizationName(null);
     $this->assertFails($this->pass, PassValidator::ORGANIZATION_NAME_REQUIRED);
     $this->pass->setOrganizationName('0');
     $this->assertPasses($this->pass, PassValidator::ORGANIZATION_NAME_REQUIRED);
 }
예제 #2
0
 public function testRequiredInformationInPassNotOverwrittenByFactory()
 {
     $passOrganizationName = 'organization name in pass';
     $passTeamIdentifier = 'team identifier in pass';
     $passPassTypeIdentifier = 'pass type identifier in pass';
     $pass = new Pass('serial number', 'description');
     $pass->setOrganizationName($passOrganizationName);
     $pass->setTeamIdentifier($passTeamIdentifier);
     $pass->setPassTypeIdentifier($passPassTypeIdentifier);
     $this->factory->setOutputPath('/tmp');
     $this->factory->setOverwrite(true);
     $this->factory->setSkipSignature(true);
     $this->factory->package($pass);
     self::assertEquals($passOrganizationName, $pass->getOrganizationName());
     self::assertEquals($passTeamIdentifier, $pass->getTeamIdentifier());
     self::assertEquals($passPassTypeIdentifier, $pass->getPassTypeIdentifier());
 }