From 43f4b3a7c8fbb585a44fb7a619e2546b338a8934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20R=C3=B3bert?= <6097856+meszarosrob@users.noreply.github.com> Date: Thu, 16 Nov 2023 13:19:47 +0200 Subject: [PATCH] Fix referencing nonexistent header theme properties (#38) --- src/Properties/ThemeProperties.php | 14 +++++++------- tests/unit/Properties/ThemePropertiesTest.php | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Properties/ThemeProperties.php b/src/Properties/ThemeProperties.php index c1bdf05..b620609 100644 --- a/src/Properties/ThemeProperties.php +++ b/src/Properties/ThemeProperties.php @@ -26,15 +26,15 @@ class ThemeProperties extends BaseProperties */ protected const HEADERS = [ self::PROP_AUTHOR => 'Author', - self::PROP_AUTHOR_URI => 'Author URI', + self::PROP_AUTHOR_URI => 'AuthorURI', self::PROP_DESCRIPTION => 'Description', - self::PROP_DOMAIN_PATH => 'Domain Path', - self::PROP_NAME => 'Theme Name', - self::PROP_TEXTDOMAIN => 'Text Domain', - self::PROP_URI => 'Theme URI', + self::PROP_DOMAIN_PATH => 'DomainPath', + self::PROP_NAME => 'Name', + self::PROP_TEXTDOMAIN => 'TextDomain', + self::PROP_URI => 'ThemeURI', self::PROP_VERSION => 'Version', - self::PROP_REQUIRES_WP => 'Requires at least', - self::PROP_REQUIRES_PHP => 'Requires PHP', + self::PROP_REQUIRES_WP => 'RequiresWP', + self::PROP_REQUIRES_PHP => 'RequiresPHP', // additional headers self::PROP_STATUS => 'Status', diff --git a/tests/unit/Properties/ThemePropertiesTest.php b/tests/unit/Properties/ThemePropertiesTest.php index 724d293..34ea8bf 100644 --- a/tests/unit/Properties/ThemePropertiesTest.php +++ b/tests/unit/Properties/ThemePropertiesTest.php @@ -26,7 +26,7 @@ public function testBasic(): void $expectedUri = 'http://github.com/inpsyde/modularity'; $expectedVersion = '1.0'; $expectedPhpVersion = "7.4"; - $expecteWpVersion = "5.3"; + $expectedWpVersion = "5.3"; $expectedStatus = 'publish'; $expectedTags = ['foo', 'bar']; @@ -36,15 +36,15 @@ public function testBasic(): void $values = [ 'Author' => $expectedAuthor, - 'Author URI' => $expectedAuthorUri, + 'AuthorURI' => $expectedAuthorUri, 'Description' => $expectedDescription, - 'Domain Path' => $expectedDomainPath, - 'Theme Name' => $expectedName, - 'Text Domain' => $expectedTextDomain, - 'Theme URI' => $expectedUri, + 'DomainPath' => $expectedDomainPath, + 'Name' => $expectedName, + 'TextDomain' => $expectedTextDomain, + 'ThemeURI' => $expectedUri, 'Version' => $expectedVersion, - 'Requires at least' => $expecteWpVersion, - 'Requires PHP' => $expectedPhpVersion, + 'RequiresWP' => $expectedWpVersion, + 'RequiresPHP' => $expectedPhpVersion, 'Status' => $expectedStatus, 'Tags' => $expectedTags, // No child-Theme. @@ -78,7 +78,7 @@ public function testBasic(): void static::assertSame($expectedTextDomain, $testee->textDomain()); static::assertSame($expectedUri, $testee->uri()); static::assertSame($expectedVersion, $testee->version()); - static::assertSame($expecteWpVersion, $testee->requiresWp()); + static::assertSame($expectedWpVersion, $testee->requiresWp()); static::assertSame($expectedPhpVersion, $testee->requiresPhp()); // specific methods for Themes.