From 21601fd78448ede37bc6f55c9880fc27a4df9ae3 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:08:19 +0200 Subject: increasing difference for modifcation time tests one second is sometimes not enough when using a slow storage connection, three seconds is working better (at least when testing against S3) --- tests/lib/files/storage/storage.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index fb3e05e66b3..155a99d8bab 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -168,10 +168,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->isReadable('/lorem.txt')); $ctimeEnd = time(); $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 1)); - $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 1)); + $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 3)); + $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 3)); - $this->assertTrue(($ctimeStart - 1) <= $mTime); + $this->assertTrue(($ctimeStart - 3) <= $mTime); $this->assertTrue($mTime <= ($ctimeEnd + 1)); $this->assertEquals(filesize($textFile), $this->instance->filesize('/lorem.txt')); @@ -185,10 +185,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $mtimeEnd = time(); if ($supportsTouch !== false) { $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 1) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 1)); + $this->assertTrue(($mtimeStart - 3) <= $mTime); + $this->assertTrue($mTime <= ($mtimeEnd + 3)); - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 1)); + $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 3)); if ($this->instance->touch('/lorem.txt', 100) !== false) { $mTime = $this->instance->filemtime('/lorem.txt'); @@ -203,11 +203,11 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { clearstatcache(); $mtimeEnd = time(); $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 1) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 1)); + $this->assertTrue(($mtimeStart - 3) <= $mTime); + $this->assertTrue($mTime <= ($mtimeEnd + 3)); $this->instance->unlink('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 1)); + $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 3)); } public function testSearch() { -- cgit v1.2.3 From 81acfc9498d1451d7266dbad024cd3d29d7d0b1a Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:11:54 +0200 Subject: test copying and moving files in subdirectories --- tests/lib/files/storage/storage.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 155a99d8bab..4a3a0c40e08 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -129,6 +129,16 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->file_exists('/target2.txt')); $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt')); + + // check if it's working inside directories as well + $this->instance->mkdir('/folder'); + $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); + $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); + $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); + $this->instance->file_put_contents('/folder/lorem.txt', ''); + $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); + $this->instance->rmdir('/folder'); + $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } public function testLocal() { -- cgit v1.2.3 From e556b7ab5504a039553f92696be6124db51a2a39 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:16:50 +0200 Subject: test working with subdirectories --- tests/lib/files/storage/storage.php | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 4a3a0c40e08..e5cc9483871 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -79,6 +79,54 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { } } $this->assertEquals(array(), $content); + + $this->assertTrue($this->instance->mkdir('/folder')); + $this->assertTrue($this->instance->mkdir('/folder/sub_a')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b/sub_bb')); + $this->assertTrue($this->instance->touch('/folder/sub_b/sub_bb/file.txt')); + $this->assertTrue($this->instance->touch('/folder/sub_a/file.txt')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertTrue($this->instance->file_exists('/folder/sub_a/file.txt')); + $this->assertTrue($this->instance->file_exists('/folder/sub_b/sub_bb/file.txt')); + + $dh = $this->instance->opendir('/folder'); + $content = array(); + while ($file = readdir($dh)) { + if ($file != '.' and $file != '..') { + $content[] = $file; + } + } + $this->assertEquals(array('sub_a', 'sub_b'), $content); + + $dh = $this->instance->opendir('/folder/sub_b/sub_bb'); + $content = array(); + while ($file = readdir($dh)) { + if ($file != '.' and $file != '..') { + $content[] = $file; + } + } + $this->assertEquals(array('file.txt'), $content); + + $this->assertTrue($this->instance->rmdir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertFalse($this->instance->file_exists('/folder/sub_b/sub_bb/file.txt')); + + $dh = $this->instance->opendir('/folder'); + $content = array(); + while ($file = readdir($dh)) { + if ($file != '.' and $file != '..') { + $content[] = $file; + } + } + $this->assertEquals(array('sub_a'), $content); + + $this->assertTrue($this->instance->rmdir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder/sub_a')); + $this->assertFalse($this->instance->file_exists('/folder/sub_a/file.txt')); } /** -- cgit v1.2.3 From 0a5e18335ec4fef9fc0ea7b6778628b7471962bd Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:23:09 +0200 Subject: test working with files in subdirectories --- tests/lib/files/storage/storage.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index e5cc9483871..8f6a8771ba8 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -127,6 +127,16 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->instance->is_dir('/folder')); $this->assertFalse($this->instance->is_dir('/folder/sub_a')); $this->assertFalse($this->instance->file_exists('/folder/sub_a/file.txt')); + + // check if it's working inside directories as well + $this->instance->mkdir('/folder'); + $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); + $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); + $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); + $this->instance->file_put_contents('/folder/lorem.txt', ''); + $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); + $this->instance->rmdir('/folder'); + $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } /** -- cgit v1.2.3 From 407753f59402c7377db1d1badbf198616a1ac563 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:34:33 +0200 Subject: move new tests into the correct test method --- tests/lib/files/storage/storage.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 8f6a8771ba8..771fad8c61b 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -154,6 +154,16 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { //empty the file $this->instance->file_put_contents('/lorem.txt', ''); $this->assertEquals('', $this->instance->file_get_contents('/lorem.txt'), 'file not emptied'); + + // check if it's working inside directories as well + $this->instance->mkdir('/folder'); + $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); + $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); + $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); + $this->instance->file_put_contents('/folder/lorem.txt', ''); + $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); + $this->instance->rmdir('/folder'); + $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } /** @@ -187,16 +197,6 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->file_exists('/target2.txt')); $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt')); - - // check if it's working inside directories as well - $this->instance->mkdir('/folder'); - $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); - $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); - $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); - $this->instance->file_put_contents('/folder/lorem.txt', ''); - $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); - $this->instance->rmdir('/folder'); - $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } public function testLocal() { -- cgit v1.2.3 From 818e2a364a6ff3eae0e463fb117e6f17166b3dd1 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:38:34 +0200 Subject: test moving and copying of subdirectories --- tests/lib/files/storage/storage.php | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 771fad8c61b..b694a76ddfe 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -197,6 +197,47 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->file_exists('/target2.txt')); $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt')); + + $this->assertTrue($this->instance->mkdir('/folder')); + $this->assertTrue($this->instance->mkdir('/folder/sub_a')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b/sub_bb')); + + $this->assertTrue($this->instance->rename('/folder/sub_b', '/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); + + $this->assertTrue($this->instance->rename('/folder', '/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->copy('/folder_b', '/folder')); + $this->assertTrue($this->instance->is_dir('/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); + $this->assertTrue($this->instance->is_dir('/folder')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->copy('/folder/sub_c', '/folder/sub_b')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->rmdir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder/sub_a')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); } public function testLocal() { -- cgit v1.2.3 From 37254744b5b1d0f5761837dee1e33ad63dcff101 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 3 Jul 2013 18:41:14 +0200 Subject: remove tests from the wrong test method --- tests/lib/files/storage/storage.php | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index b694a76ddfe..8db3aed1fa5 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -127,16 +127,6 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->instance->is_dir('/folder')); $this->assertFalse($this->instance->is_dir('/folder/sub_a')); $this->assertFalse($this->instance->file_exists('/folder/sub_a/file.txt')); - - // check if it's working inside directories as well - $this->instance->mkdir('/folder'); - $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); - $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); - $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); - $this->instance->file_put_contents('/folder/lorem.txt', ''); - $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); - $this->instance->rmdir('/folder'); - $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } /** -- cgit v1.2.3 From 92e73928529f00aa1638777995fdd5c91ee05275 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 4 Jul 2013 09:01:36 +0200 Subject: revoking additional tests --- tests/lib/files/storage/storage.php | 99 ------------------------------------- 1 file changed, 99 deletions(-) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 8db3aed1fa5..155a99d8bab 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -79,54 +79,6 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { } } $this->assertEquals(array(), $content); - - $this->assertTrue($this->instance->mkdir('/folder')); - $this->assertTrue($this->instance->mkdir('/folder/sub_a')); - $this->assertTrue($this->instance->mkdir('/folder/sub_b')); - $this->assertTrue($this->instance->mkdir('/folder/sub_b/sub_bb')); - $this->assertTrue($this->instance->touch('/folder/sub_b/sub_bb/file.txt')); - $this->assertTrue($this->instance->touch('/folder/sub_a/file.txt')); - $this->assertTrue($this->instance->is_dir('/folder/sub_b')); - $this->assertTrue($this->instance->is_dir('/folder/sub_b/sub_bb')); - $this->assertTrue($this->instance->file_exists('/folder/sub_a/file.txt')); - $this->assertTrue($this->instance->file_exists('/folder/sub_b/sub_bb/file.txt')); - - $dh = $this->instance->opendir('/folder'); - $content = array(); - while ($file = readdir($dh)) { - if ($file != '.' and $file != '..') { - $content[] = $file; - } - } - $this->assertEquals(array('sub_a', 'sub_b'), $content); - - $dh = $this->instance->opendir('/folder/sub_b/sub_bb'); - $content = array(); - while ($file = readdir($dh)) { - if ($file != '.' and $file != '..') { - $content[] = $file; - } - } - $this->assertEquals(array('file.txt'), $content); - - $this->assertTrue($this->instance->rmdir('/folder/sub_b')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); - $this->assertFalse($this->instance->file_exists('/folder/sub_b/sub_bb/file.txt')); - - $dh = $this->instance->opendir('/folder'); - $content = array(); - while ($file = readdir($dh)) { - if ($file != '.' and $file != '..') { - $content[] = $file; - } - } - $this->assertEquals(array('sub_a'), $content); - - $this->assertTrue($this->instance->rmdir('/folder')); - $this->assertFalse($this->instance->is_dir('/folder')); - $this->assertFalse($this->instance->is_dir('/folder/sub_a')); - $this->assertFalse($this->instance->file_exists('/folder/sub_a/file.txt')); } /** @@ -144,16 +96,6 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { //empty the file $this->instance->file_put_contents('/lorem.txt', ''); $this->assertEquals('', $this->instance->file_get_contents('/lorem.txt'), 'file not emptied'); - - // check if it's working inside directories as well - $this->instance->mkdir('/folder'); - $this->instance->file_put_contents('/folder/lorem.txt', $sourceText); - $this->assertFalse($this->instance->is_dir('/folder/lorem.txt')); - $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data'); - $this->instance->file_put_contents('/folder/lorem.txt', ''); - $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied'); - $this->instance->rmdir('/folder'); - $this->assertFalse($this->instance->file_exists('/folder/lorem.txt')); } /** @@ -187,47 +129,6 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->file_exists('/target2.txt')); $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt')); - - $this->assertTrue($this->instance->mkdir('/folder')); - $this->assertTrue($this->instance->mkdir('/folder/sub_a')); - $this->assertTrue($this->instance->mkdir('/folder/sub_b')); - $this->assertTrue($this->instance->mkdir('/folder/sub_b/sub_bb')); - - $this->assertTrue($this->instance->rename('/folder/sub_b', '/folder/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); - - $this->assertTrue($this->instance->rename('/folder', '/folder_b')); - $this->assertTrue($this->instance->is_dir('/folder_b')); - $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); - $this->assertFalse($this->instance->is_dir('/folder')); - $this->assertFalse($this->instance->is_dir('/folder/sub_c')); - $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); - - $this->assertTrue($this->instance->copy('/folder_b', '/folder')); - $this->assertTrue($this->instance->is_dir('/folder_b')); - $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); - $this->assertTrue($this->instance->is_dir('/folder')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); - - $this->assertTrue($this->instance->copy('/folder/sub_c', '/folder/sub_b')); - $this->assertTrue($this->instance->is_dir('/folder/sub_b')); - $this->assertTrue($this->instance->is_dir('/folder/sub_b/sub_bb')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c')); - $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); - - $this->assertTrue($this->instance->rmdir('/folder')); - $this->assertFalse($this->instance->is_dir('/folder')); - $this->assertFalse($this->instance->is_dir('/folder/sub_a')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b')); - $this->assertFalse($this->instance->is_dir('/folder/sub_c')); - $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); - $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); } public function testLocal() { -- cgit v1.2.3 From 8c9e6db1b10c8dac559d3eaec0952e9b733dc7fe Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 8 Jul 2013 15:03:55 +0200 Subject: increasing allowed time difference --- tests/lib/files/storage/storage.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/lib/files/storage/storage.php') diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 155a99d8bab..fbf502fbc1c 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -168,10 +168,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->isReadable('/lorem.txt')); $ctimeEnd = time(); $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 3)); - $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 3)); + $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 5)); + $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 5)); - $this->assertTrue(($ctimeStart - 3) <= $mTime); + $this->assertTrue(($ctimeStart - 5) <= $mTime); $this->assertTrue($mTime <= ($ctimeEnd + 1)); $this->assertEquals(filesize($textFile), $this->instance->filesize('/lorem.txt')); @@ -185,10 +185,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $mtimeEnd = time(); if ($supportsTouch !== false) { $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 3) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 3)); + $this->assertTrue(($mtimeStart - 5) <= $mTime); + $this->assertTrue($mTime <= ($mtimeEnd + 5)); - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 3)); + $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 5)); if ($this->instance->touch('/lorem.txt', 100) !== false) { $mTime = $this->instance->filemtime('/lorem.txt'); @@ -203,11 +203,11 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { clearstatcache(); $mtimeEnd = time(); $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue(($mtimeStart - 3) <= $mTime); - $this->assertTrue($mTime <= ($mtimeEnd + 3)); + $this->assertTrue(($mtimeStart - 5) <= $mTime); + $this->assertTrue($mTime <= ($mtimeEnd + 5)); $this->instance->unlink('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 3)); + $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 5)); } public function testSearch() { -- cgit v1.2.3