$t->is($v->clean($dir . '//./'), $dir, '->clean() cleans an existing misspelled directory.');
} catch (sfValidatorError $e) {
    $t->fail('->clean() cleans an existing misspelled directory.');
}
# invalid value
try {
    $v->clean($dir . '/non-existing-dir');
    $t->fail('->clean() throw an sfValidatorError if the value is not an existing directory');
    $t->skip('', 1);
} catch (sfValidatorError $e) {
    $t->pass('->clean() throw an sfValidatorError if the value is not an existing directory');
    $t->is($e->getCode(), 'invalid', '->clean() throw an "invalid" sfValidatorError');
}
# value is inside root path
try {
    $v->setOption('root', $dir);
    $v->clean(__FILE__);
    $t->pass('->clean() accepts a value that in inside the root path');
} catch (sfValidatorError $e) {
    $t->fail('->clean() accepts a value that in inside the root path');
}
#value is relative
try {
    $v->setOption('root', dirname($dir));
    $v->setOption('relative', true);
    $t->is($v->clean(basename($dir)), $dir, '->clean() accepts a relative value that in inside the root path');
} catch (sfValidatorError $e) {
    $t->fail('->clean() accepts a relative value that in inside the root path');
}
$v->setOption('relative', false);
#value is '/' but relative