mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Merge pull request #42790 from nextcloud/fix/fix-settings-appdirs-test
Fix AppDirsWithDifferentOwnerTest
This commit is contained in:
commit
e5ef58b7b9
2 changed files with 20 additions and 20 deletions
|
|
@ -86,13 +86,6 @@ class CheckSetupControllerTest extends TestCase {
|
|||
/** @var ISetupCheckManager|MockObject */
|
||||
private $setupCheckManager;
|
||||
|
||||
/**
|
||||
* Holds a list of directories created during tests.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $dirsToRemove = [];
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
|
|
@ -145,19 +138,6 @@ class CheckSetupControllerTest extends TestCase {
|
|||
])->getMock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes directories created during tests.
|
||||
*
|
||||
* @after
|
||||
* @return void
|
||||
*/
|
||||
public function removeTestDirectories() {
|
||||
foreach ($this->dirsToRemove as $dirToRemove) {
|
||||
rmdir($dirToRemove);
|
||||
}
|
||||
$this->dirsToRemove = [];
|
||||
}
|
||||
|
||||
public function testCheck() {
|
||||
$this->config->expects($this->any())
|
||||
->method('getAppValue')
|
||||
|
|
|
|||
|
|
@ -33,6 +33,13 @@ class AppDirsWithDifferentOwnerTest extends TestCase {
|
|||
private IL10N $l10n;
|
||||
private AppDirsWithDifferentOwner $check;
|
||||
|
||||
/**
|
||||
* Holds a list of directories created during tests.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $dirsToRemove = [];
|
||||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
|
|
@ -97,4 +104,17 @@ class AppDirsWithDifferentOwnerTest extends TestCase {
|
|||
$this->invokePrivate($this->check, 'getAppDirsWithDifferentOwner', [posix_getuid()])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes directories created during tests.
|
||||
*
|
||||
* @after
|
||||
* @return void
|
||||
*/
|
||||
public function removeTestDirectories() {
|
||||
foreach ($this->dirsToRemove as $dirToRemove) {
|
||||
rmdir($dirToRemove);
|
||||
}
|
||||
$this->dirsToRemove = [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue