-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix(theming): read image keys from Mime-suffixed key in theming:config #64381
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
Open
shawon9324
wants to merge
11
commits into
nextcloud:master
Choose a base branch
from
shawon9324:fix/theming-config-image-key-read
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+72
−1
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e1ade0e
fix(theming): read image keys from Mime-suffixed storage key in themi…
shawon9324 3408621
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 7063658
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 119e2d2
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 d4f3b86
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 276a23d
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 b3437d9
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 981ded8
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 b7bf88c
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 50502cb
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 2918fcd
Merge branch 'master' into fix/theming-config-image-key-read
shawon9324 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||
| */ | ||
|
|
||
| namespace OCA\Theming\Tests\Command; | ||
|
|
||
| use OCA\Theming\Command\UpdateConfig; | ||
| use OCA\Theming\ImageManager; | ||
| use OCA\Theming\ThemingDefaults; | ||
| use OCP\IConfig; | ||
| use PHPUnit\Framework\MockObject\MockObject; | ||
| use Symfony\Component\Console\Tester\CommandTester; | ||
| use Test\TestCase; | ||
|
|
||
| class UpdateConfigTest extends TestCase { | ||
| private ThemingDefaults&MockObject $themingDefaults; | ||
| private ImageManager&MockObject $imageManager; | ||
| private IConfig&MockObject $config; | ||
| private CommandTester $cmd; | ||
|
|
||
| #[\Override] | ||
| protected function setUp(): void { | ||
| parent::setUp(); | ||
|
|
||
| $this->themingDefaults = $this->createMock(ThemingDefaults::class); | ||
| $this->imageManager = $this->createMock(ImageManager::class); | ||
| $this->config = $this->createMock(IConfig::class); | ||
|
|
||
| $command = new UpdateConfig($this->themingDefaults, $this->imageManager, $this->config); | ||
| $this->cmd = new CommandTester($command); | ||
| } | ||
|
|
||
| public function testReadRegularKeyThatIsSet(): void { | ||
| $this->config->expects($this->once()) | ||
| ->method('getAppValue') | ||
| ->with('theming', 'name', '') | ||
| ->willReturn('My Cloud'); | ||
|
|
||
| $this->cmd->execute(['key' => 'name']); | ||
|
|
||
| $this->assertStringContainsString('name is currently set to My Cloud', $this->cmd->getDisplay()); | ||
| } | ||
|
|
||
| public function testReadImageKeyThatIsSetReadsFromMimeSuffixedStorageKey(): void { | ||
| $this->config->expects($this->once()) | ||
| ->method('getAppValue') | ||
| ->with('theming', 'logoMime', '') | ||
| ->willReturn('image/png'); | ||
|
|
||
| $this->cmd->execute(['key' => 'logo']); | ||
|
|
||
| $this->assertStringContainsString('logo is currently set to image/png', $this->cmd->getDisplay()); | ||
| } | ||
|
|
||
| public function testReadImageKeyThatIsNotSet(): void { | ||
| $this->config->expects($this->once()) | ||
| ->method('getAppValue') | ||
| ->with('theming', 'logoMime', '') | ||
| ->willReturn(''); | ||
|
|
||
| $this->cmd->execute(['key' => 'logo']); | ||
|
|
||
| $this->assertStringContainsString('logo is currently not set', $this->cmd->getDisplay()); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.