hajtest
Current file: D:\websites\haj\application\forms\Register.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2
0.00%0.00%
0.00% 0 / 100
 
Application_Form_Register
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2
0.00%0.00%
0.00% 0 / 99
 public function init()
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 96
 public function setPrice(array $price)
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 2


       1                 :                                                                                                                                                                                                                                     
       2               0 : <?php                                                                                                                                                                                                                               
       3                 :                                                                                                                                                                                                                                     
       4               0 : class Application_Form_Register extends Application_Form_Base {                                                                                                                                                                     
       5                 :                                                                                                                                                                                                                                     
       6                 :     protected $decorators = array(                                                                                                                                                                                                  
       7                 :         array('ViewHelper'),                                                                                                                                                                                                        
       8                 :         array('Errors'),                                                                                                                                                                                                            
       9                 :         array('Label'),                                                                                                                                                                                                             
      10                 :     );                                                                                                                                                                                                                              
      11                 :                                                                                                                                                                                                                                     
      12                 :     public function init() {                                                                                                                                                                                                        
      13               0 :         $this->setAction('/register/process/')                                                                                                                                                                                      
      14               0 :                 ->setMethod('POST');                                                                                                                                                                                                
      15                 :                                                                                                                                                                                                                                     
      16                 :         //   ->addValidator('NotEmpty',false,array(                                                                                                                                                                                 
      17                 :         //   'messages'=>array(                                                                                                                                                                                                     
      18                 :         //   'isEmpty'=>'Date From Cannot be empty'                                                                                                                                                                                 
      19                 :         //   )));                                                                                                                                                                                                                   
      20                 :                                                                                                                                                                                                                                     
      21               0 :         $firstName = new Zend_Form_Element_Text('first_name', array(                                                                                                                                                                
      22                 :                     'required' => true                                                                                                                                                                                              
      23               0 :                 ));                                                                                                                                                                                                                 
      24               0 :         $firstName->setLabel('First Name: ');                                                                                                                                                                                       
      25               0 :         $notEmpty = new Zend_Validate_NotEmpty();                                                                                                                                                                                   
      26               0 :         $notEmpty->setMessage('You must enter your first name.');                                                                                                                                                                   
      27               0 :         $firstName->addValidator($notEmpty);                                                                                                                                                                                        
      28               0 :         $firstName->addFilter(new Zend_Filter_StringTrim());                                                                                                                                                                        
      29               0 :         $firstName->setDecorators($this->decorators);                                                                                                                                                                               
      30               0 :         $this->addElement($firstName);                                                                                                                                                                                              
      31                 :                                                                                                                                                                                                                                     
      32                 :                                                                                                                                                                                                                                     
      33               0 :         $lastName = new Zend_Form_Element_Text('last_name', array(                                                                                                                                                                  
      34                 :                     'required' => true                                                                                                                                                                                              
      35               0 :                 ));                                                                                                                                                                                                                 
      36               0 :         $lastName->setLabel('Last Name: ');                                                                                                                                                                                         
      37               0 :         $notEmpty = new Zend_Validate_NotEmpty();                                                                                                                                                                                   
      38               0 :         $notEmpty->setMessage('You must enter your last name.');                                                                                                                                                                    
      39               0 :         $lastName->addValidator($notEmpty);                                                                                                                                                                                         
      40               0 :         $lastName->addFilter(new Zend_Filter_StringTrim());                                                                                                                                                                         
      41               0 :         $lastName->setDecorators($this->decorators);                                                                                                                                                                                
      42               0 :         $this->addElement($lastName);                                                                                                                                                                                               
      43                 :                                                                                                                                                                                                                                     
      44               0 :         $email = new Zend_Form_Element_Text('email', array('required' => true));                                                                                                                                                    
      45               0 :         $email->setLabel('Email: ')                                                                                                                                                                                                 
      46               0 :                 ->addFilters(array('StringTrim', 'StringToLower'))                                                                                                                                                                  
      47               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      48               0 :         $notEmpty = new Zend_Validate_NotEmpty();                                                                                                                                                                                   
      49               0 :         $notEmpty->setMessage('Your email is required and cannot be empty.');                                                                                                                                                       
      50               0 :         $emailRegex = new Zend_Validate_Regex(array(                                                                                                                                                                                
      51               0 :                     'pattern' => '/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i'));
					
      52               0 :         $emailRegex->setMessage('Improperly formatted email address \'%value%\'');                                                                                                                                                  
      53               0 :         $email->addValidator($notEmpty, true);                                                                                                                                                                                      
      54               0 :         $email->addValidator($emailRegex, true);                                                                                                                                                                                    
      55               0 :         $this->addElement($email);                                                                                                                                                                                                  
      56                 :                                                                                                                                                                                                                                     
      57                 :                                                                                                                                                                                                                                     
      58               0 :         $street = new Zend_Form_Element_Text('street');                                                                                                                                                                             
      59               0 :         $street->setLabel('Street: ')                                                                                                                                                                                               
      60               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
      61               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      62               0 :         $this->addElement($street);                                                                                                                                                                                                 
      63                 :                                                                                                                                                                                                                                     
      64                 :                                                                                                                                                                                                                                     
      65               0 :         $city = new Zend_Form_Element_Text('city');                                                                                                                                                                                 
      66               0 :         $city->setLabel('City: ')                                                                                                                                                                                                   
      67               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
      68               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      69               0 :         $this->addElement($city);                                                                                                                                                                                                   
      70                 :                                                                                                                                                                                                                                     
      71                 :                                                                                                                                                                                                                                     
      72               0 :         $state = new Zend_Form_Element_Select('state');                                                                                                                                                                             
      73               0 :         $state->setLabel("State: ")                                                                                                                                                                                                 
      74               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
      75               0 :                 ->addMultiOptions(HAJ_Form_Misc::getStateList())                                                                                                                                                                    
      76               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      77               0 :         $this->addElement($state);                                                                                                                                                                                                  
      78                 :                                                                                                                                                                                                                                     
      79               0 :         $zip = new Zend_Form_Element_Text('zip');                                                                                                                                                                                   
      80               0 :         $zip->setLabel('Zip: ')                                                                                                                                                                                                     
      81               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
      82               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      83               0 :         $this->addElement($zip);                                                                                                                                                                                                    
      84                 :                                                                                                                                                                                                                                     
      85               0 :         $phone = new Zend_Form_Element_Text('phone');                                                                                                                                                                               
      86               0 :         $phone->setLabel('Phone: ')                                                                                                                                                                                                 
      87               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
      88               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      89               0 :         $this->addElement($phone);                                                                                                                                                                                                  
      90                 :                                                                                                                                                                                                                                     
      91               0 :         $phoneContact = new Zend_Form_Element_Checkbox('phone_contact');                                                                                                                                                            
      92               0 :         $phoneContact->setLabel('Would you like to be contacted by phone?')                                                                                                                                                         
      93               0 :                 ->setValue(1)                                                                                                                                                                                                       
      94               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
      95               0 :         $this->addElement($phoneContact);                                                                                                                                                                                           
      96                 :                                                                                                                                                                                                                                             
      97               0 :                 $newsletter = new Zend_Form_Element_Checkbox('newsletter');                                                                                                                                                         
      98               0 :         $newsletter->setLabel('Would you like a once a month newsletter?')                                                                                                                                                          
      99               0 :                 ->setValue(1)                                                                                                                                                                                                       
     100               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
     101               0 :         $this->addElement($newsletter);                                                                                                                                                                                             
     102                 :                                                                                                                                                                                                                                     
     103                 :                                                                                                                                                                                                                                     
     104               0 :         $bestTime = new Zend_Form_Element_Textarea('best_time_to_reach');                                                                                                                                                           
     105               0 :         $bestTime->setLabel("What is the best way/time to contact you?")                                                                                                                                                            
     106               0 :                 ->setAttribs(array('rows' => 3, 'cols' => 40,))                                                                                                                                                                     
     107               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
     108               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
     109               0 :         $this->addElement($bestTime);                                                                                                                                                                                               
     110                 :                                                                                                                                                                                                                                     
     111                 :                                                                                                                                                                                                                                     
     112               0 :         $comments = new Zend_Form_Element_Textarea('comments');                                                                                                                                                                     
     113               0 :         $comments->setLabel("Questions, Comments, Feedback?")                                                                                                                                                                       
     114               0 :                 ->setAttribs(array('rows' => 3, 'cols' => 40,))                                                                                                                                                                     
     115               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
     116               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
     117               0 :         $this->addElement($comments);                                                                                                                                                                                               
     118                 :                                                                                                                                                                                                                                     
     119               0 :         $promo = new Zend_Form_Element_Text('promo');                                                                                                                                                                               
     120               0 :         $promo->setLabel('Promo Code(s) (if any):')                                                                                                                                                                                 
     121               0 :                 ->setAttribs(array('size' => 8))                                                                                                                                                                                    
     122               0 :                 ->addFilter(new Zend_Filter_StringTrim())                                                                                                                                                                           
     123               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
     124               0 :         $this->addElement($promo);                                                                                                                                                                                                  
     125                 :                                                                                                                                                                                                                                     
     126                 :                                                                                                                                                                                                                                     
     127               0 :         $price = new Zend_Form_Element_Radio('price', array('required' => true));                                                                                                                                                   
     128               0 :         $price->setLabel('Price Options: ')                                                                                                                                                                                         
     129               0 :                 ->setDecorators($this->decorators);                                                                                                                                                                                 
     130               0 :         $notEmpty = new Zend_Validate_NotEmpty();                                                                                                                                                                                   
     131               0 :         $notEmpty->setMessage('You must select a price option.');                                                                                                                                                                   
     132               0 :         $price->addValidator($notEmpty, true);                                                                                                                                                                                      
     133               0 :         $this->addElement($price);                                                                                                                                                                                                  
     134                 :                                                                                                                                                                                                                                     
     135               0 :         $submit = new Zend_Form_Element_Submit('submit', 'submit');                                                                                                                                                                 
     136               0 :         $this->addElement($submit);                                                                                                                                                                                                 
     137                 :                                                                                                                                                                                                                                     
     138                 : //        // create bindings: forms_name =  doctrine_model_name                                                                                                                                                                     
     139                 : //        foreach ($this->getElements() as $name => $element) {                                                                                                                                                                     
     140                 : //            $this->bind($name, $name);                                                                                                                                                                                            
     141                 : //        }                                                                                                                                                                                                                         
     142               0 :     }                                                                                                                                                                                                                               
     143                 :                                                                                                                                                                                                                                     
     144                 :     public function setPrice(array $price) {                                                                                                                                                                                        
     145               0 :         $this->getElement('price')->setMultiOptions($price);                                                                                                                                                                        
     146               0 :     }                                                                                                                                                                                                                               
     147                 :                                                                                                                                                                                                                                     

Generated by PHPUnit 3.4.15 and Xdebug 2.1.0rc1 using PHP 5.3.1 at Mon Jan 17 15:42:18 PST 2011.