Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bootstrap.php3
-rw-r--r--tests/lib/files/filesystem.php6
-rw-r--r--tests/lib/files/storage/commontest.php5
-rw-r--r--tests/phpunit-autotest.xml14
4 files changed, 21 insertions, 7 deletions
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index b97161ee6e4..fb667263e45 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -2,6 +2,9 @@
global $RUNTIME_NOAPPS;
$RUNTIME_NOAPPS = true;
+
+define('PHPUNIT_RUN', 1);
+
require_once __DIR__.'/../lib/base.php';
if(!class_exists('PHPUnit_Framework_TestCase')) {
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index 5837093fdd6..fd116af2d2e 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -93,14 +93,14 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
$rootView->mkdir('/'.$user);
$rootView->mkdir('/'.$user.'/files');
- \OC\Files\Filesystem::file_put_contents('/foo', 'foo');
+// \OC\Files\Filesystem::file_put_contents('/foo', 'foo');
\OC\Files\Filesystem::mkdir('/bar');
- \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo');
+// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo');
$tmpFile = \OC_Helper::tmpFile();
file_put_contents($tmpFile, 'foo');
$fh = fopen($tmpFile, 'r');
- \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh);
+// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh);
}
public function dummyHook($arguments) {
diff --git a/tests/lib/files/storage/commontest.php b/tests/lib/files/storage/commontest.php
index 744d4608420..ce53c884f32 100644
--- a/tests/lib/files/storage/commontest.php
+++ b/tests/lib/files/storage/commontest.php
@@ -28,10 +28,7 @@ class CommonTest extends Storage {
*/
private $tmpDir;
public function setUp() {
- $this->tmpDir=get_temp_dir().'/filestoragecommon';
- if(!file_exists($this->tmpDir)) {
- mkdir($this->tmpDir);
- }
+ $this->tmpDir=\OC_Helper::tmpFolder();
$this->instance=new \OC\Files\Storage\CommonTest(array('datadir'=>$this->tmpDir));
}
diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml
new file mode 100644
index 00000000000..23cd123edc6
--- /dev/null
+++ b/tests/phpunit-autotest.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<phpunit bootstrap="bootstrap.php">
+ <testsuite name='ownCloud'>
+ <directory suffix='.php'>lib/</directory>
+ <file>apps.php</file>
+ </testsuite>
+ <!-- filters for code coverage -->
+ <whitelist processUncoveredFilesFromWhitelist="true">
+ <directory suffix=".php">..</directory>
+ <exclude>
+ <directory suffix=".php">../3rdparty</directory>
+ </exclude>
+ </whitelist>
+</phpunit>