Exemplo n.º 1
0
 function testKeySetPreperation()
 {
     $basePath = '/' . Test_Encryption_Keymanager::TEST_USER . '/files';
     $path = '/folder1/subfolder/subsubfolder/file.txt';
     $this->assertFalse($this->view->is_dir($basePath . '/testKeySetPreperation'));
     $result = TestProtectedKeymanagerMethods::testKeySetPreperation($this->view, $path, $basePath);
     // return path without leading slash
     $this->assertSame('folder1/subfolder/subsubfolder/file.txt', $result);
     // check if directory structure was created
     $this->assertTrue($this->view->is_dir($basePath . '/folder1/subfolder/subsubfolder'));
     // cleanup
     $this->view->deleteAll($basePath . '/folder1');
 }
Exemplo n.º 2
0
 /**
  * @small
  *
  * @dataProvider fileNameFromShareKeyProvider
  */
 function testGetFilenameFromShareKey($fileName, $user, $expectedFileName)
 {
     $this->assertEquals($expectedFileName, \TestProtectedKeymanagerMethods::testGetFilenameFromShareKey($fileName, $user));
 }
Exemplo n.º 3
0
 function testKeySetPreperation()
 {
     $basePath = '/' . self::TEST_USER . '/files';
     $path = '/folder1/subfolder/subsubfolder/file.txt';
     $this->assertFalse($this->view->is_dir($basePath . '/testKeySetPreperation'));
     TestProtectedKeymanagerMethods::testKeySetPreperation($this->view, $basePath . $path);
     // check if directory structure was created
     $this->assertTrue($this->view->is_dir($basePath . $path));
     // cleanup
     $this->view->deleteAll($basePath . '/folder1');
 }
Exemplo n.º 4
0
 /**
  * @small
  */
 function testGetFilenameFromShareKey()
 {
     $this->assertEquals("file", \TestProtectedKeymanagerMethods::testGetFilenameFromShareKey("file.user.shareKey"));
     $this->assertEquals("file.name.with.dots", \TestProtectedKeymanagerMethods::testGetFilenameFromShareKey("file.name.with.dots.user.shareKey"));
     $this->assertFalse(\TestProtectedKeymanagerMethods::testGetFilenameFromShareKey("file.txt"));
 }