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();
 }
 protected function addPermissions()
 {
     $this->output(t('Adding permissions...'));
     CacheLocal::delete('permission_keys', false);
     $ci = new ContentImporter();
     $ci->importContentFile(DIR_BASE_CORE . '/config/install/base/permissions.xml');
     CacheLocal::delete('permission_keys', false);
 }
Exemplo n.º 3
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);
 }