feat: Fähigkeiten theme-option-read/-write und font-upload; ThemeOptionsAdapter und FontCatalog (Manifest, Nachbau customizer-typography, Signatur-Referenzen) und DesignRights::themeOptions()/fonts()
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
8379c55c89
commit
a90cd7f5bd
@@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class DiviFeatureTest extends TestCase
|
||||
{
|
||||
public function testTheThirteenFeaturesAndTheirValues(): void
|
||||
public function testTheSixteenFeaturesAndTheirValues(): void
|
||||
{
|
||||
self::assertSame(
|
||||
[
|
||||
@@ -21,6 +21,9 @@ final class DiviFeatureTest extends TestCase
|
||||
'PresetWrite' => 'preset-write',
|
||||
'ColorWrite' => 'color-write',
|
||||
'VariableWrite' => 'variable-write',
|
||||
'ThemeOptionRead' => 'theme-option-read',
|
||||
'ThemeOptionWrite' => 'theme-option-write',
|
||||
'FontUpload' => 'font-upload',
|
||||
'LibraryRead' => 'library-read',
|
||||
'LibraryWrite' => 'library-write',
|
||||
'Roles' => 'roles',
|
||||
@@ -34,7 +37,7 @@ final class DiviFeatureTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testOnlyTheSixWriteFeaturesWrite(): void
|
||||
public function testOnlyTheEightWriteFeaturesWrite(): void
|
||||
{
|
||||
$writing = array_values(array_map(
|
||||
static fn (DiviFeature $feature): string => $feature->value,
|
||||
@@ -42,7 +45,10 @@ final class DiviFeatureTest extends TestCase
|
||||
));
|
||||
|
||||
self::assertSame(
|
||||
['page-write', 'preset-write', 'color-write', 'variable-write', 'library-write', 'tb-write'],
|
||||
[
|
||||
'page-write', 'preset-write', 'color-write', 'variable-write', 'theme-option-write', 'font-upload',
|
||||
'library-write', 'tb-write',
|
||||
],
|
||||
$writing
|
||||
);
|
||||
}
|
||||
@@ -56,6 +62,9 @@ final class DiviFeatureTest extends TestCase
|
||||
self::assertSame('Theme Builder lesen', DiviFeature::ThemeBuilderRead->label());
|
||||
self::assertSame('Farben schreiben', DiviFeature::ColorWrite->label());
|
||||
self::assertSame('Variablen schreiben', DiviFeature::VariableWrite->label());
|
||||
self::assertSame('Theme-Optionen lesen', DiviFeature::ThemeOptionRead->label());
|
||||
self::assertSame('Theme-Optionen schreiben', DiviFeature::ThemeOptionWrite->label());
|
||||
self::assertSame('Schriften hochladen', DiviFeature::FontUpload->label());
|
||||
foreach ($labels as $label) {
|
||||
self::assertNotSame('', trim($label));
|
||||
}
|
||||
@@ -64,6 +73,7 @@ final class DiviFeatureTest extends TestCase
|
||||
public function testValuesResolveBackToTheFeature(): void
|
||||
{
|
||||
self::assertSame(DiviFeature::ThemeBuilderWrite, DiviFeature::from('tb-write'));
|
||||
self::assertSame(DiviFeature::ThemeOptionWrite, DiviFeature::from('theme-option-write'));
|
||||
self::assertNull(DiviFeature::tryFrom('page'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user