public function setUp()
 {
     parent::setUp();
     $langFactory = $this->getMockBuilder('OC\\L10N\\Factory')->disableOriginalConstructor()->getMock();
     $urlGenerator = $this->getMockBuilder('OCP\\IURLGenerator')->disableOriginalConstructor()->getMock();
     $this->activity = new Activity($langFactory, $urlGenerator);
 }
Пример #2
0
 public function setUp()
 {
     parent::setUp();
     $this->ruleMapper = new RuleMapper($this->db);
     $this->ruleMapper->deleteAll();
     $this->ruleMapper->populate();
 }
Пример #3
0
 public function setUp()
 {
     parent::setUp();
     //Bgscanner requires at least one user on the current instance
     $userManager = $this->application->getContainer()->query('ServerContainer')->getUserManager();
     $results = $userManager->search('', 1, 0);
     if (!count($results)) {
         \OC_User::createUser('test', 'test');
     }
     $this->scannerFactory = new ScannerFactory($this->config, $this->container->query('Logger'));
 }
Пример #4
0
 public function setUp()
 {
     parent::setUp();
     \OC_User::clearBackends();
     \OC_User::useBackend(new \OC_User_Dummy());
     \OC\Files\Filesystem::clearMounts();
     //login
     \OC_User::createUser('test', 'test');
     \OC::$server->getSession()->set('user_id', 'test');
     $this->storage = new \OC\Files\Storage\Temporary(array());
     \OC\Files\Filesystem::init('test', '');
     \OC\Files\Filesystem::clearMounts();
     \OC\Files\Filesystem::mount($this->storage, array(), '/');
     \OC\Files\Filesystem::file_put_contents('file1', self::CONTENT);
     $this->config->method('getAvChunkSize')->willReturn('1024');
 }
Пример #5
0
 public function setUp()
 {
     parent::setUp();
     $this->view = $this->getMockBuilder('\\OC\\Files\\View')->disableOriginalConstructor()->getMock();
     $this->view->method('getOwner')->willReturn('Dummy');
     $this->view->method('file_exists')->willReturn(true);
     $this->view->method('filesize')->willReturn(42);
     $this->cleanItem = new Item($this->l10n, $this->view, self::TEST_CLEAN_FILENAME, 42);
     $this->infectedItem = new Item($this->l10n, $this->view, self::TEST_INFECTED_FILENAME, 42);
     $this->ruleMapper = new RuleMapper($this->db);
     $this->ruleMapper->deleteAll();
     $this->ruleMapper->populate();
     //Bgscanner requires at least one user on the current instance
     $userManager = $this->application->getContainer()->query('ServerContainer')->getUserManager();
     $results = $userManager->search('', 1, 0);
     if (!count($results)) {
         \OC_User::createUser('test', 'test');
     }
     $this->scannerFactory = new ScannerFactory($this->config, $this->container->query('Logger'));
 }