From ccd964df293e8bdc769871c8c84467874f40554f Mon Sep 17 00:00:00 2001 From: Pedro Cunha Date: Thu, 31 Oct 2024 13:05:34 +0000 Subject: [PATCH] Remove ids entirely since they're unused and causing issues Release 0.8.0 --- src/Resources/Build.php | 5 ----- src/Resources/Mod.php | 1 - src/Resources/Modpack.php | 1 - src/SolderClient.php | 2 +- tests/ClientTest.php | 17 ----------------- tests/DynamicPropertiesTest.php | 12 ++++++------ 6 files changed, 7 insertions(+), 31 deletions(-) diff --git a/src/Resources/Build.php b/src/Resources/Build.php index 34cd42a..b70fe48 100644 --- a/src/Resources/Build.php +++ b/src/Resources/Build.php @@ -4,7 +4,6 @@ class Build { - public ?string $id = null; public string $minecraft; public ?string $java = null; public ?int $memory = 0; @@ -16,10 +15,6 @@ class Build public function __construct($properties) { - if (array_key_exists('id', $properties)) { - $this->id = $properties['id']; - } - $this->minecraft = $properties['minecraft']; if (array_key_exists('java', $properties)) { diff --git a/src/Resources/Mod.php b/src/Resources/Mod.php index ba06f7a..287ec02 100644 --- a/src/Resources/Mod.php +++ b/src/Resources/Mod.php @@ -4,7 +4,6 @@ class Mod { - public ?string $id = null; public string $name = ""; public ?string $version = null; public string $md5 = ""; diff --git a/src/Resources/Modpack.php b/src/Resources/Modpack.php index a180964..31e9830 100644 --- a/src/Resources/Modpack.php +++ b/src/Resources/Modpack.php @@ -4,7 +4,6 @@ class Modpack { - public ?string $id = null; public string $name = ""; public string $display_name = ""; public ?string $url = null; diff --git a/src/SolderClient.php b/src/SolderClient.php index 128a5ee..368d6e6 100644 --- a/src/SolderClient.php +++ b/src/SolderClient.php @@ -20,7 +20,7 @@ class SolderClient public string $key; private Client $client; - const VERSION = '0.7.6'; + const VERSION = '0.8.0'; public static function factory($url, $key, $headers = [], $handler = null, $timeout = 3): SolderClient { diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 11ffc49..ef755d3 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -292,7 +292,6 @@ public function testGetBuild() $this->assertCount(1, $build->mods); $mod = $build->mods[0]; - $this->assertSame('30', $mod->id); $this->assertSame('armorbar', $mod->name); $this->assertSame('v0.7.1', $mod->version); $this->assertSame('f323a8d582302ea0abd615a223f8a68b', $mod->md5); @@ -314,20 +313,4 @@ public function testBadPack() $this->expectException(ConnectionException::class); SolderClient::factory('https://solder.example.net/api/', '', [], []); } - - public function testBuildUuid() - { - $props = [ - 'id' => '9e002c63-a8e5-47fa-b9a2-369f7ab9fe5d', - 'minecraft' => '1.0', - ]; - - $build = new Build($props); - - $this->assertObjectHasProperty('id', $build); - $this->assertObjectHasProperty('minecraft', $build); - - $this->assertSame('9e002c63-a8e5-47fa-b9a2-369f7ab9fe5d', $build->id); - $this->assertSame('1.0', $build->minecraft); - } } diff --git a/tests/DynamicPropertiesTest.php b/tests/DynamicPropertiesTest.php index 5fd45cb..6a501b4 100644 --- a/tests/DynamicPropertiesTest.php +++ b/tests/DynamicPropertiesTest.php @@ -12,30 +12,30 @@ class DynamicPropertiesTest extends TestCase public function testMod() { $props = [ - 'id' => 1, + 'name' => 'foo', 'extra' => 'stuff', ]; $mod = new Mod($props); - $this->assertTrue(property_exists($mod, 'id')); + $this->assertTrue(property_exists($mod, 'name')); $this->assertFalse(property_exists($mod, 'extra')); - $this->assertSame('1', $mod->id); + $this->assertSame('foo', $mod->name); } public function testModpack() { $props = [ - 'id' => 1, + 'name' => 'foo', 'extra' => 'stuff', ]; $modpack = new Modpack($props); - $this->assertTrue(property_exists($modpack, 'id')); + $this->assertTrue(property_exists($modpack, 'name')); $this->assertFalse(property_exists($modpack, 'extra')); - $this->assertSame('1', $modpack->id); + $this->assertSame('foo', $modpack->name); } }