$con->beginTransaction();
try {
    // prepare test environment
    $folderProvider->doDeleteAll();
    $assetProvider->doDeleteAll();
    sfConfig::set('app_sfAssetsLibrary_upload_dir', 'medias');
    $root = new sfAssetFolder();
    $root->setName(sfConfig::get('app_sfAssetsLibrary_upload_dir'));
    $folderProvider->createRoot($root);
    $root->save();
    // run the tests
    $t = new lime_test(23, new lime_output_color());
    $t->diag('sfAsset');
    $sfAsset = new sfAsset();
    $sfAsset->setsfAssetFolder($root);
    $t->isa_ok($sfAsset->getsfAssetFolder(), 'sfAssetFolder', 'sfAsset can have root as folder');
    $sfAsset->setFilename('filename.jpg');
    $t->diag('sfAsset::getRelativePath()');
    $t->is($sfAsset->getRelativePath(), sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'filename.jpg', 'getRelativePath() returns the path relative to the media directory');
    $t->diag('sfAsset::getFullPath()');
    $t->is($sfAsset->getFullPath(), sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'filename.jpg', 'getFullPath() returns the complete asset path on the disk');
    $t->is($sfAsset->getFullPath('small'), sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'thumbnail/small_filename.jpg', 'getFullPath(\'small\') returns the complete small thumbnail path on the disk');
    $t->is($sfAsset->getFullPath('large'), sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'thumbnail/large_filename.jpg', 'getFullPath(\'large\') returns the complete large thumbnail path on the disk');
    $t->diag('sfAsset::getUrl()');
    $t->is($sfAsset->getUrl(), DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'filename.jpg', 'getUrl() returns the asset URL');
    $t->is($sfAsset->getUrl('small'), DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'thumbnail/small_filename.jpg', 'getUrl(\'small\') returns the small thumbnail url');
    $t->is($sfAsset->getUrl('large'), DIRECTORY_SEPARATOR . sfConfig::get('app_sfAssetsLibrary_upload_dir') . DIRECTORY_SEPARATOR . 'thumbnail/large_filename.jpg', 'getUrl(\'large\') returns the large thumbnail url');
    $t->diag('sfAsset::create()');
    $assets_path = dirname(__FILE__) . '/../assets/';
    $test_asset = $assets_path . 'raikkonen.jpg';
    $folder1 = new sfAssetFolder();