Example #1
0
 public function testThatEvenSomeTinyStringsAreValidStrings()
 {
     $validator = new C3op_Util_ValidString();
     $string = "A";
     $this->assertTrue($validator->isValid($string));
     $string = "bc";
     $this->assertTrue($validator->isValid($string));
     $string = "0";
     $this->assertTrue($validator->isValid($string));
 }
Example #2
0
 public function SetDescription($description)
 {
     $validator = new C3op_Util_ValidString();
     if ($validator->isValid($description)) {
         if ($this->description != $description) {
             $this->description = $description;
         }
     } else {
         throw new C3op_Projects_HumanResourceException("This ({$description}) is not a valid description.");
     }
 }
Example #3
0
 public function SetTitle($title)
 {
     $validator = new C3op_Util_ValidString();
     if ($validator->isValid($title)) {
         if ($this->title != $title) {
             $this->title = $title;
         }
     } else {
         throw new C3op_Projects_ReceivableException("This ({$title}) is not a valid title.");
     }
 }
Example #4
0
 public function SetName($name)
 {
     $validator = new C3op_Util_ValidString();
     if ($validator->isValid($name)) {
         if ($this->name != $name) {
             $this->name = $name;
         }
     } else {
         throw new C3op_Auth_UserException("This ({$name}) is not a valid name.");
     }
 }
Example #5
0
 public function SetWebsite($website)
 {
     $validator = new C3op_Util_ValidString();
     if ($validator->isValid($website)) {
         if ($this->website != $website) {
             $this->website = $website;
         }
     } else {
         throw new C3op_Register_InstitutionException("This ({$website}) is not a valid website.");
     }
 }
Example #6
0
 public function SetPosition($position)
 {
     $validator = new C3op_Util_ValidString();
     if ($validator->isValid($position)) {
         if ($this->position != $position) {
             $this->position = $position;
         }
     } else {
         throw new C3op_Register_LinkageException("This ({$position}) is not a valid Local Register Number.");
     }
 }