Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AppDirsWithDifferentOwnerTest #42790

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions apps/settings/tests/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -145,19 +138,6 @@ protected function setUp(): void {
])->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')
Expand Down
20 changes: 20 additions & 0 deletions apps/settings/tests/SetupChecks/AppDirsWithDifferentOwnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -97,4 +104,17 @@ public function testAppDirectoryOwnersNotWritable() {
$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