Merge pull request #9698 from owncloud/fix-9666
Load apps in tests, fixes #9666
This commit is contained in:
commit
e6af67d5ea
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once __DIR__ . '/../../../lib/base.php';
|
|
||||||
|
|
||||||
class Test_Mount_Config_Dummy_Storage {
|
class Test_Mount_Config_Dummy_Storage {
|
||||||
public function test() {
|
public function test() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -60,7 +58,7 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
\OC_User::setUserId(self::TEST_USER1);
|
\OC_User::setUserId(self::TEST_USER1);
|
||||||
$this->userHome = \OC_User::getHome(self::TEST_USER1);
|
$this->userHome = \OC_User::getHome(self::TEST_USER1);
|
||||||
mkdir($this->userHome);
|
@mkdir($this->userHome);
|
||||||
|
|
||||||
$this->dataDir = \OC_Config::getValue(
|
$this->dataDir = \OC_Config::getValue(
|
||||||
'datadirectory',
|
'datadirectory',
|
||||||
|
|
|
@ -10,6 +10,10 @@ if ($configDir) {
|
||||||
|
|
||||||
require_once __DIR__ . '/../lib/base.php';
|
require_once __DIR__ . '/../lib/base.php';
|
||||||
|
|
||||||
|
// load minimum set of apps
|
||||||
|
OC_App::loadApps(array('authentication'));
|
||||||
|
OC_App::loadApps(array('filesystem', 'logging'));
|
||||||
|
|
||||||
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
require_once('PHPUnit/Autoload.php');
|
require_once('PHPUnit/Autoload.php');
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Scanner extends \PHPUnit_Framework_TestCase {
|
||||||
$storage->file_put_contents('foo.txt', 'qwerty');
|
$storage->file_put_contents('foo.txt', 'qwerty');
|
||||||
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
||||||
|
|
||||||
$scanner = new TestScanner('');
|
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection());
|
||||||
$scanner->addMount($mount);
|
$scanner->addMount($mount);
|
||||||
|
|
||||||
$scanner->scan('');
|
$scanner->scan('');
|
||||||
|
@ -71,7 +71,7 @@ class Scanner extends \PHPUnit_Framework_TestCase {
|
||||||
$storage->file_put_contents('foo.txt', 'qwerty');
|
$storage->file_put_contents('foo.txt', 'qwerty');
|
||||||
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
||||||
|
|
||||||
$scanner = new TestScanner('');
|
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection());
|
||||||
$scanner->addMount($mount);
|
$scanner->addMount($mount);
|
||||||
|
|
||||||
$scanner->scan('');
|
$scanner->scan('');
|
||||||
|
@ -98,7 +98,7 @@ class Scanner extends \PHPUnit_Framework_TestCase {
|
||||||
$storage->file_put_contents('foo.txt', 'qwerty');
|
$storage->file_put_contents('foo.txt', 'qwerty');
|
||||||
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
$storage->file_put_contents('folder/bar.txt', 'qwerty');
|
||||||
|
|
||||||
$scanner = new TestScanner('');
|
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection());
|
||||||
$originalPropagator = $scanner->getPropagator();
|
$originalPropagator = $scanner->getPropagator();
|
||||||
$scanner->setPropagator($propagator);
|
$scanner->setPropagator($propagator);
|
||||||
$scanner->addMount($mount);
|
$scanner->addMount($mount);
|
||||||
|
|
Loading…
Reference in New Issue