View test needs a dummy user

This commit is contained in:
Bart Visscher 2013-06-26 20:48:54 +02:00
parent a9ee15cf40
commit 0c680b46cd
1 changed files with 9 additions and 0 deletions

View File

@ -20,10 +20,19 @@ class View extends \PHPUnit_Framework_TestCase {
private $storages = array();
public function setUp() {
\OC_User::clearBackends();
\OC_User::useBackend(new \OC_User_Dummy());
//login
\OC_User::createUser('test', 'test');
$this->user=\OC_User::getUser();
\OC_User::setUserId('test');
\OC\Files\Filesystem::clearMounts();
}
public function tearDown() {
\OC_User::setUserId($this->user);
foreach ($this->storages as $storage) {
$cache = $storage->getCache();
$ids = $cache->getAll();