diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-19 19:09:11 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-19 19:09:11 +0400 |
commit | ee581f56ea091b99d0640821de3e4ae207bc2d74 (patch) | |
tree | 28feb2b2cb5acdfa2e9cb2a4b31f105febcd3f25 /tests | |
parent | fbf1b127db2421b47874ee49be89d9dbaa6c2dda (diff) | |
parent | 79929fb6fae506276e957f289a8c58640ed7ff1d (diff) |
Merge pull request #5893 from owncloud/stable5-extstorage-smbfixes
[stable5] External storage SMB fixes for stat and unlink backport
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/storage/storage.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 4089853f02f..4587a3b2d06 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -182,8 +182,9 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 1)); $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 1)); - $this->assertTrue(($ctimeStart - 1) <= $mTime); - $this->assertTrue($mTime <= ($ctimeEnd + 1)); + // check that ($ctimeStart - 1) <= $mTime <= ($ctimeEnd + 1) + $this->assertGreaterThanOrEqual(($ctimeStart - 1), $mTime); + $this->assertLessThanOrEqual(($ctimeEnd + 1), $mTime); $this->assertEquals(filesize($textFile), $this->instance->filesize('/lorem.txt')); $stat = $this->instance->stat('/lorem.txt'); @@ -249,6 +250,17 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertContains('/sub/logo-wide.png', $result); } + public function testUnlink() { + $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; + $this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile)); + + $this->assertTrue($this->instance->file_exists('/lorem.txt')); + + $this->assertTrue($this->instance->unlink('/lorem.txt')); + + $this->assertFalse($this->instance->file_exists('/lorem.txt')); + } + public function testFOpen() { $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; |