summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-06-11 01:52:10 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-06-11 01:52:10 -0700
commit74b1f7d448f2d1f73817b7c8508db687d39856c7 (patch)
treeb23d31861cad3a158630b717686f638e75f9c8c2 /tests
parent4f0f537b422015fb5573d3b50c3d0a7137a1384d (diff)
parentc70a0f791ded08cb0c8c4a0e131c328d36cbec33 (diff)
downloadnextcloud-server-74b1f7d448f2d1f73817b7c8508db687d39856c7.tar.gz
nextcloud-server-74b1f7d448f2d1f73817b7c8508db687d39856c7.zip
Merge pull request #3646 from owncloud/introduce_phpunit_timeouts
add timeouts 3/30/90 to phpunit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/db.php3
-rw-r--r--tests/lib/dbschema.php3
-rw-r--r--tests/lib/files/cache/watcher.php6
-rw-r--r--tests/lib/files/view.php24
-rw-r--r--tests/lib/geo.php4
-rw-r--r--tests/phpunit-autotest.xml7
6 files changed, 46 insertions, 1 deletions
diff --git a/tests/lib/db.php b/tests/lib/db.php
index 7b2a5e309f0..3c38acb558b 100644
--- a/tests/lib/db.php
+++ b/tests/lib/db.php
@@ -51,6 +51,9 @@ class Test_DB extends PHPUnit_Framework_TestCase {
$this->assertFalse($row);
}
+ /**
+ * @medium
+ */
public function testNOW() {
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)');
$result = $query->execute(array('uri_2'));
diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php
index dbc1283964f..6631c929cf2 100644
--- a/tests/lib/dbschema.php
+++ b/tests/lib/dbschema.php
@@ -36,6 +36,9 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
}
// everything in one test, they depend on each other
+ /**
+ * @medium
+ */
public function testSchema() {
$this->doTestSchemaCreating();
$this->doTestSchemaChanging();
diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php
index e43c86ed438..749b1ab75a3 100644
--- a/tests/lib/files/cache/watcher.php
+++ b/tests/lib/files/cache/watcher.php
@@ -29,6 +29,9 @@ class Watcher extends \PHPUnit_Framework_TestCase {
}
}
+ /**
+ * @medium
+ */
function testWatcher() {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
@@ -63,6 +66,9 @@ class Watcher extends \PHPUnit_Framework_TestCase {
$this->assertFalse($cache->inCache('folder/bar2.txt'));
}
+ /**
+ * @medium
+ */
public function testFileToFolder() {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 01f9a9cca11..830913a91ad 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -33,6 +33,9 @@ class View extends \PHPUnit_Framework_TestCase {
}
}
+ /**
+ * @medium
+ */
public function testCacheAPI() {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
@@ -104,6 +107,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(), $rootView->getDirectoryContent('/non/existing'));
}
+ /**
+ * @medium
+ */
function testGetPath() {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
@@ -127,6 +133,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertNull($folderView->getPath($id1));
}
+ /**
+ * @medium
+ */
function testMountPointOverwrite() {
$storage1 = $this->getTestStorage(false);
$storage2 = $this->getTestStorage();
@@ -170,6 +179,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals($textSize, $folderData[0]['size']);
}
+ /**
+ * @medium
+ */
function testSearch() {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
@@ -217,6 +229,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals(3, count($folderView->searchByMime('text')));
}
+ /**
+ * @medium
+ */
function testWatcher() {
$storage1 = $this->getTestStorage();
\OC\Files\Filesystem::mount($storage1, array(), '/');
@@ -234,6 +249,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals(3, $cachedData['size']);
}
+ /**
+ * @medium
+ */
function testCopyBetweenStorages() {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
@@ -255,6 +273,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertTrue($rootView->file_exists('/substorage/folder/bar.txt'));
}
+ /**
+ * @medium
+ */
function testMoveBetweenStorages() {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
@@ -271,6 +292,9 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertTrue($rootView->file_exists('anotherfolder/bar.txt'));
}
+ /**
+ * @medium
+ */
function testTouch() {
$storage = $this->getTestStorage(true, '\Test\Files\TemporaryNoTouch');
diff --git a/tests/lib/geo.php b/tests/lib/geo.php
index 82e61608687..2c3611c092e 100644
--- a/tests/lib/geo.php
+++ b/tests/lib/geo.php
@@ -7,6 +7,10 @@
*/
class Test_Geo extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @medium
+ */
function testTimezone() {
$result = OC_Geo::timezone(3, 3);
$expected = 'Africa/Porto-Novo';
diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml
index e9ee7d8d70d..d74451cbe6c 100644
--- a/tests/phpunit-autotest.xml
+++ b/tests/phpunit-autotest.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
-<phpunit bootstrap="bootstrap.php">
+<phpunit bootstrap="bootstrap.php"
+ strict="true"
+ timeoutForSmallTests="3"
+ timeoutForMediumTests="30"
+ timeoutForLargeTests="90"
+>
<testsuite name='ownCloud'>
<directory suffix='.php'>lib/</directory>
<file>apps.php</file>