Exemplo n.º 1
0
 /**
  * Test that checkDataDirectoryValidity and checkServer
  * both return an error when ".ocdata" is missing.
  */
 public function testCheckDataDirValidityWhenFileMissing()
 {
     unlink($this->datadir . '/.ocdata');
     $result = \OC_Util::checkDataDirectoryValidity($this->datadir);
     $this->assertEquals(1, count($result));
     $result = \OC_Util::checkServer($this->getConfig(array('installed' => true, 'version' => implode('.', \OCP\Util::getVersion()))));
     $this->assertCount(1, $result);
 }
Exemplo n.º 2
0
 public function testCheckDataDirectoryValidity()
 {
     $dataDir = \OCP\Files::tmpFolder();
     touch($dataDir . '/.ocdata');
     $errors = \OC_Util::checkDataDirectoryValidity($dataDir);
     $this->assertEmpty($errors);
     \OCP\Files::rmdirr($dataDir);
     $dataDir = \OCP\Files::tmpFolder();
     // no touch
     $errors = \OC_Util::checkDataDirectoryValidity($dataDir);
     $this->assertNotEmpty($errors);
     \OCP\Files::rmdirr($dataDir);
     if (!\OC_Util::runningOnWindows()) {
         $errors = \OC_Util::checkDataDirectoryValidity('relative/path');
         $this->assertNotEmpty($errors);
     }
 }
Exemplo n.º 3
0
 /**
  * Test that checkDataDirectoryValidity and checkServer 
  * both return an error when ".ocdata" is missing.
  */
 public function testCheckDataDirValidityWhenFileMissing()
 {
     unlink($this->datadir . '/.ocdata');
     $result = \OC_Util::checkDataDirectoryValidity($this->datadir);
     $this->assertEquals(1, count($result));
     $result = \OC_Util::checkServer();
     $this->assertEquals(1, count($result));
 }