Skip to content

Commit

Permalink
Fix AppDirsWithDifferentOwnerTest
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jan 15, 2024
1 parent 17dd695 commit ed87e4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
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 = [];
}
}

0 comments on commit ed87e4b

Please sign in to comment.