$t->is($w->render(null), fix_linebreaks($output), '->render() decorates the widget');
// implements ArrayAccess
$t->diag('implements ArrayAccess');
$w['w2'] = $w2;
$t->is($w->getFields(), array('w1' => $w1, 'w2' => $w2), 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->is($ws->getFields(), array('w1' => $w1, 'w2' => $w2), 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
try {
    $w['w1'] = 'string';
    $t->fail('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
} catch (LogicException $e) {
    $t->pass('sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
}
$w = new sfWidgetFormSchemaDecorator($ws, "<table>\n%content%</table>");
$t->is(isset($w['w1']), true, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->is(isset($w['w2']), true, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->is(isset($ws['w1']), true, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->is(isset($ws['w2']), true, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$w = new sfWidgetFormSchemaDecorator($ws, "<table>\n%content%</table>");
$t->ok($w['w1'] == $w1, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->ok($w['w2'] == $w2, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->ok($ws['w1'] == $w1, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->ok($ws['w2'] == $w2, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$w = new sfWidgetFormSchemaDecorator($ws, "<table>\n%content%</table>");
unset($w['w1']);
$t->is($w['w1'], null, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
$t->is($ws['w1'], null, 'sfWidgetFormSchemaDecorator implements the ArrayAccess interface for the fields');
// __clone()
$t->diag('__clone()');
$w1 = clone $w;
$t->ok($w1->getWidget() !== $w->getWidget(), '__clone() clones the embedded widget');
//$t->ok($w1->getWidget() == $w->getWidget(), '__clone() clones the embedded widget');