Skip to content

Commit

Permalink
chore(files_versions): Only mock getSystemValue method to avoid probl…
Browse files Browse the repository at this point in the history
…ems in files_versions tests

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 26, 2024
1 parent 790f728 commit a5d8dae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/files_versions/tests/VersioningTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use OCA\Files_Versions\Versions\IVersionManager;
use OCP\Constants;
use OCP\Files\IMimeTypeLoader;
use OCP\IConfig;
use OCP\IUser;
use OCP\Server;
use OCP\Share\IShare;
Expand Down Expand Up @@ -79,7 +78,10 @@ protected function setUp(): void {
parent::setUp();

$config = \OC::$server->getConfig();
$mockConfig = $this->createMock(IConfig::class);
$mockConfig = $this->getMockBuilder(AllConfig::class)
->onlyMethods(['getSystemValue'])
->setConstructorArgs([Server::get(\OC\SystemConfig::class)])
->getMock();
$mockConfig->expects($this->any())
->method('getSystemValue')
->willReturnCallback(function ($key, $default) use ($config) {
Expand Down

0 comments on commit a5d8dae

Please sign in to comment.