Skip to content

Commit cae8f06

Browse files
garvinhickingGarvin Hicking
andauthored
[TASK] Add tests for "theme-camino" special format (not "cms-theme-camino") (#1151)
Luckily the tests pass already! Co-authored-by: Garvin Hicking <garvin.hicking@ppw.de>
1 parent 28474d7 commit cae8f06

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/typo3-docs-theme/tests/unit/Inventory/DefaultInterlinkParserTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public static function vendorPackageProvider(): \Generator
3434
// core
3535
yield 'core no version' => ['typo3/cms-adminpanel', 'core', 'typo3', 'cms-adminpanel', null];
3636
yield 'core with version' => ['typo3/cms-adminpanel/13.4', 'core', 'typo3', 'cms-adminpanel', '13.4'];
37+
yield 'core without cms prefix, no version' => ['typo3/theme-camino', 'core', 'typo3', 'theme-camino', null];
38+
yield 'core without cms prefix, with version' => ['typo3/theme-camino/13.4', 'core', 'typo3', 'theme-camino', '13.4'];
3739

3840
// generic package
3941
yield 'package' => ['georgringer/news', 'package', 'georgringer', 'news', null];

packages/typo3-docs-theme/tests/unit/Inventory/DefaultInventoryUrlBuilderTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ public function legacy_ext_behaves_like_core_and_uses_preferred(): void
6565
);
6666
}
6767

68+
#[Test]
69+
public function theme_ext_behaves_like_core_and_uses_preferred(): void
70+
{
71+
$this->versions->method('getPreferredVersion')->willReturn('13.4');
72+
$this->versions->method('resolveCoreVersion')->willReturn('13.4');
73+
74+
$builder = new DefaultInventoryUrlBuilder($this->versions);
75+
$parts = new InterlinkParts('typo3/theme-camino', 'core', 'typo3', 'theme-camino', null);
76+
77+
self::assertSame(
78+
'https://docs.typo3.org/c/typo3/theme-camino/13.4/en-us/',
79+
$builder->buildUrl($parts)
80+
);
81+
}
82+
6883
#[Test]
6984
#[DataProvider('packageVersions')]
7085
public function third_party_packages_use_p_namespace_and_generic_version_resolution(string $inputVersion, string $resolvedMinor, string $expectedUrl): void

0 commit comments

Comments
 (0)