Development

Changeset 5996

You must first sign up to be able to contribute.

Changeset 5996

Show
Ignore:
Timestamp:
11/13/07 16:50:20 (1 year ago)
Author:
fabien
Message:

added method to sfWidgetFormSchema to manage help messages + added a way to format help messages in formatter classes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/unit/widget/sfWidgetFormSchemaFormatterListTest.php

    r5937 r5996  
    2020<li> 
    2121  label 
    22   <input />help 
     22  <input /><br />help 
    2323</li> 
    2424 
  • trunk/test/unit/widget/sfWidgetFormSchemaFormatterTableTest.php

    r5937 r5996  
    2020<tr> 
    2121  <th>label</th> 
    22   <td><input />help</td> 
     22  <td><input /><br />help</td> 
    2323</tr> 
    2424 
  • trunk/test/unit/widget/sfWidgetFormSchemaTest.php

    r5937 r5996  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(48, new lime_output_color()); 
     13$t = new lime_test(50, new lime_output_color()); 
    1414 
    1515$w1 = new sfWidgetFormInput(array(), array('class' => 'foo1')); 
     
    118118$t->is($w->generateLabelName('first_name'), 'A first name', '->setLabel() sets a label value'); 
    119119$t->is($w->getLabels(), array('first_name' => 'A first name'), '->getLabels() returns all current labels'); 
     120 
     121// ->setHelps() ->getHelps() ->setHelp() ->getHelp() 
     122$t->diag('->setHelps() ->getHelps() ->setHelp() ->getHelp()'); 
     123$w = new sfWidgetFormSchema(); 
     124$w->setHelps(array('first_name', 'Please, provide your first name')); 
     125$t->is($w->getHelps(), array('first_name', 'Please, provide your first name'), '->setHelps() changes all help messages'); 
     126$w->setHelp('last_name', 'Please, provide your last name'); 
     127$t->is($w->getHelp('last_name'), 'Please, provide your last name', '->setHelp() changes one help message'); 
    120128 
    121129// ->generateLabel()