mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
test: replace OC_Helper:rmdirr with OCP\Files::rmdirr
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
3868d62a8f
commit
494a079321
8 changed files with 22 additions and 10 deletions
|
|
@ -10,6 +10,7 @@ namespace Test\Files;
|
|||
use OC\Files\Mount\MountPoint;
|
||||
use OC\Files\Storage\Temporary;
|
||||
use OC\User\NoUserException;
|
||||
use OCP\Files;
|
||||
use OCP\Files\Config\IMountProvider;
|
||||
use OCP\Files\Storage\IStorageFactory;
|
||||
use OCP\IUser;
|
||||
|
|
@ -74,7 +75,7 @@ class FilesystemTest extends \Test\TestCase {
|
|||
|
||||
protected function tearDown(): void {
|
||||
foreach ($this->tmpDirs as $dir) {
|
||||
\OC_Helper::rmdirr($dir);
|
||||
Files::rmdirr($dir);
|
||||
}
|
||||
|
||||
$this->logout();
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ namespace Test\Files\Storage;
|
|||
|
||||
use OC\Files\Storage\Wrapper\Jail;
|
||||
use OC\Files\Storage\Wrapper\Wrapper;
|
||||
use OCP\Files;
|
||||
use OCP\Files\IFilenameValidator;
|
||||
use OCP\Files\InvalidCharacterInPathException;
|
||||
use OCP\Files\InvalidPathException;
|
||||
|
|
@ -37,7 +38,7 @@ class CommonTest extends Storage {
|
|||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
\OC_Helper::rmdirr($this->tmpDir);
|
||||
Files::rmdirr($this->tmpDir);
|
||||
$this->restoreService(IFilenameValidator::class);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
namespace Test\Files\Storage;
|
||||
|
||||
use OC\User\User;
|
||||
use OCP\Files;
|
||||
|
||||
class DummyUser extends User {
|
||||
private $home;
|
||||
|
|
@ -62,7 +63,7 @@ class HomeTest extends Storage {
|
|||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
\OC_Helper::rmdirr($this->tmpDir);
|
||||
Files::rmdirr($this->tmpDir);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
namespace Test\Files\Storage;
|
||||
|
||||
use OC\Files\Storage\Wrapper\Jail;
|
||||
use OCP\Files;
|
||||
|
||||
/**
|
||||
* Class LocalTest
|
||||
|
|
@ -30,7 +31,7 @@ class LocalTest extends Storage {
|
|||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
\OC_Helper::rmdirr($this->tmpDir);
|
||||
Files::rmdirr($this->tmpDir);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ namespace Test\Files\Storage\Wrapper;
|
|||
//ensure the constants are loaded
|
||||
use OC\Files\Cache\CacheEntry;
|
||||
use OC\Files\Storage\Local;
|
||||
use OCP\Files;
|
||||
|
||||
\OC::$loader->load('\OC\Files\Filesystem');
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
|
|||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
\OC_Helper::rmdirr($this->tmpDir);
|
||||
Files::rmdirr($this->tmpDir);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
namespace Test\Files\Storage\Wrapper;
|
||||
|
||||
use OCP\Files;
|
||||
|
||||
class WrapperTest extends \Test\Files\Storage\Storage {
|
||||
/**
|
||||
* @var string tmpDir
|
||||
|
|
@ -22,7 +24,7 @@ class WrapperTest extends \Test\Files\Storage\Storage {
|
|||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
\OC_Helper::rmdirr($this->tmpDir);
|
||||
Files::rmdirr($this->tmpDir);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
namespace Test\Preview;
|
||||
|
||||
use OCP\IBinaryFinder;
|
||||
use OCP\Server;
|
||||
|
||||
/**
|
||||
* Class OfficeTest
|
||||
*
|
||||
|
|
@ -16,10 +19,11 @@ namespace Test\Preview;
|
|||
*/
|
||||
class OfficeTest extends Provider {
|
||||
protected function setUp(): void {
|
||||
$libreofficeBinary = \OC_Helper::findBinaryPath('libreoffice');
|
||||
$openofficeBinary = ($libreofficeBinary) ? null : \OC_Helper::findBinaryPath('openoffice');
|
||||
$binaryFinder = Server::get(IBinaryFinder::class);
|
||||
$libreofficeBinary = $binaryFinder->findBinaryPath('libreoffice');
|
||||
$openofficeBinary = $libreofficeBinary === false ? $binaryFinder->findBinaryPath('openoffice') : false;
|
||||
|
||||
if ($libreofficeBinary || $openofficeBinary) {
|
||||
if ($libreofficeBinary !== false || $openofficeBinary !== false) {
|
||||
parent::setUp();
|
||||
|
||||
$fileName = 'testimage.odt';
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
namespace Test;
|
||||
|
||||
use bantu\IniGetWrapper\IniGetWrapper;
|
||||
use OCP\Files;
|
||||
use OCP\IConfig;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ class TempManagerTest extends \Test\TestCase {
|
|||
|
||||
protected function tearDown(): void {
|
||||
if ($this->baseDir !== null) {
|
||||
\OC_Helper::rmdirr($this->baseDir);
|
||||
Files::rmdirr($this->baseDir);
|
||||
}
|
||||
$this->baseDir = null;
|
||||
parent::tearDown();
|
||||
|
|
|
|||
Loading…
Reference in a new issue