protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'FileImageThumbnailTypes', 'FilePermissionAssignments', 'AttributeKeyCategories', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'SystemContentEditorSnippets', 'AttributeValues', 'atNumber', 'FileVersionLog'));
     parent::setUp();
     define('UPLOAD_FILE_EXTENSIONS_ALLOWED', '*.txt;*.jpg;*.jpeg;*.png');
     Category::add('file');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     CacheLocal::flush();
 }
Exemplo n.º 2
0
 public function testFileVersionDelete()
 {
     mkdir($this->getStorageDirectory());
     $this->getStorageLocation();
     $sample = dirname(__FILE__) . '/StorageLocation/fixtures/sample.txt';
     $fi = new Importer();
     $fi->import($sample, 'sample.txt');
     $f = \File::getByID(1);
     $fv = $f->getVersion(1);
     $this->assertEquals('sample.txt', $fv->getFilename());
     $fv->delete();
     CacheLocal::flush();
     $fv2 = $f->getVersion(1);
     $this->assertNull($fv2);
 }