improved tests for touch
This commit is contained in:
parent
0fca2f8f31
commit
67a80e1870
|
@ -788,7 +788,7 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
|
||||||
$view->unlink( $filename );
|
$view->unlink( $filename );
|
||||||
}
|
}
|
||||||
|
|
||||||
function testTouchFile() {
|
function testTouchExistingFile() {
|
||||||
$filename = '/tmp-'.time();
|
$filename = '/tmp-'.time();
|
||||||
$view = new \OC\Files\View('/' . $this->userId . '/files');
|
$view = new \OC\Files\View('/' . $this->userId . '/files');
|
||||||
|
|
||||||
|
@ -809,6 +809,27 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
|
||||||
$view->unlink( $filename );
|
$view->unlink( $filename );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testTouchFile() {
|
||||||
|
$filename = '/tmp-'.time();
|
||||||
|
$view = new \OC\Files\View('/' . $this->userId . '/files');
|
||||||
|
|
||||||
|
$view->touch($filename);
|
||||||
|
|
||||||
|
// Save short data as encrypted file using stream wrapper
|
||||||
|
$cryptedFile = $view->file_put_contents( $filename, $this->dataShort );
|
||||||
|
|
||||||
|
// Test that data was successfully written
|
||||||
|
$this->assertTrue( is_int( $cryptedFile ) );
|
||||||
|
|
||||||
|
// Get file decrypted contents
|
||||||
|
$decrypt = $view->file_get_contents( $filename );
|
||||||
|
|
||||||
|
$this->assertEquals( $this->dataShort, $decrypt );
|
||||||
|
|
||||||
|
// tear down
|
||||||
|
$view->unlink( $filename );
|
||||||
|
}
|
||||||
|
|
||||||
function testFopenFile() {
|
function testFopenFile() {
|
||||||
$filename = '/tmp-'.time();
|
$filename = '/tmp-'.time();
|
||||||
$view = new \OC\Files\View('/' . $this->userId . '/files');
|
$view = new \OC\Files\View('/' . $this->userId . '/files');
|
||||||
|
|
Loading…
Reference in New Issue