Development

Changeset 10982

You must first sign up to be able to contribute.

Changeset 10982

Show
Ignore:
Timestamp:
08/20/08 08:55:37 (11 months ago)
Author:
dwhittle
Message:

1.2: added sfFormField::getName()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/form/sfFormField.class.php

    r10440 r10982  
    44 * This file is part of the symfony package. 
    55 * (c) Fabien Potencier <fabien.potencier@symfony-project.com> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
     
    2121  protected static 
    2222    $toStringException = null; 
    23    
     23 
    2424  protected 
    2525    $widget = null, 
     
    6666    } 
    6767  } 
    68    
     68 
    6969  /** 
    7070   * Returns true if a form thrown an exception in the __toString() method 
     
    9090    return self::$toStringException; 
    9191  } 
    92    
     92 
    9393  /** 
    9494   * Sets an exception thrown by the __toString() method. 
     
    223223 
    224224  /** 
     225   * Returns the widget name. 
     226   * 
     227   * @return mixed The widget name 
     228   */ 
     229  public function getName() 
     230  { 
     231    return $this->name; 
     232  } 
     233 
     234  /** 
    225235   * Returns the widget value. 
    226236   * 
  • branches/1.2/test/unit/form/sfFormFieldTest.php

    r9238 r10982  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(25, new lime_output_color()); 
     13$t = new lime_test(26, new lime_output_color()); 
    1414 
    1515// widgets 
     
    3939 
    4040// ->getValue() ->getWidget() ->getParent() ->getError() ->hasError() 
    41 $t->diag('->getValue() ->getWidget() ->getParent() ->getError() ->hasError()'); 
     41$t->diag('->getValue() ->getName() ->getWidget() ->getParent() ->getError() ->hasError()'); 
    4242$t->ok($f->getWidget() == $titleWidget, '->getWidget() returns the form field widget'); 
     43$t->is($f->getName(), 'title', '->getName() returns the form field name'); 
    4344$t->is($f->getValue(), 'symfony', '->getValue() returns the form field value'); 
    4445$t->is($f->getParent(), $parent, '->getParent() returns the form field parent'); 
     
    215216EOF; 
    216217$t->is($child->renderError(), $output, '->renderError() renders global errors as expected (global errors, hidden field errors, non existent field errors)'); 
    217  

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.