Beispiel #1
0
 public function validation($data, $files)
 {
     $errors = parent::validation($data, $files);
     $manageremail = $data['manageremail'];
     if (!empty($manageremail)) {
         if (!facetoface_check_manageremail($manageremail)) {
             $errors['manageremail'] = facetoface_get_manageremailformat();
         }
     }
     return $errors;
 }
    function test_facetoface_check_manageremail() {
        set_config('facetoface_manageraddressformat', 'example.com');

        // Define test variables.
        $validEmail = '*****@*****.**';
        $invalidEmail = NULL;

        // Test for valid case.
        $this->assertTrue((bool)facetoface_check_manageremail($validEmail), $this->msgtrue);

        // Test for invalid case.
        $this->assertFalse((bool)facetoface_check_manageremail($invalidEmail), $this->msgfalse);
        $this->resetAfterTest(true);
    }