Development

Changeset 11961 for branches/1.1/test

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
10/05/08 20:08:57 (2 months ago)
Author:
fabien
Message:

fixed sfWidgetFormSchema don't clone the formatters (closes #4567 - patch from pablodip)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/test/unit/widget/sfWidgetFormSchemaTest.php

    r11509 r11961  
    1111require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 
    1212 
    13 $t = new lime_test(61, new lime_output_color()); 
     13$t = new lime_test(70, new lime_output_color()); 
    1414 
    1515$w1 = new sfWidgetFormInput(array(), array('class' => 'foo1')); 
     
    359359} 
    360360 
     361$w = new sfWidgetFormSchema(); 
     362$w->addFormFormatter('table', new sfWidgetFormSchemaFormatterTable($w)); 
     363$w->addFormFormatter('list', new sfWidgetFormSchemaFormatterList($w)); 
     364$w1 = clone $w; 
     365$f1 = $w1->getFormFormatters(); 
     366$f = $w->getFormFormatters(); 
     367$t->is(array_keys($f1), array_keys($f), '__clone() clones form formatters'); 
     368foreach ($f1 as $key => $formFormatter) 
     369{ 
     370  $t->ok($formFormatter !== $f[$key], '__clone() clones form formatters'); 
     371  $t->is(get_class($formFormatter), get_class($f[$key]), '__clone() clones form formatters'); 
     372 
     373  $t->ok($formFormatter->getWidgetSchema() !== $f[$key]->getWidgetSchema(), '__clone() clones form formatters'); 
     374  $t->is(get_class($formFormatter->getWidgetSchema()), get_class($f[$key]->getWidgetSchema()), '__clone() clones form formatters'); 
     375} 
     376 
    361377// setDefaultFormFormatterName() 
    362378$t->diag('setDefaultFormFormatterName()');