mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
PR review fixes
This commit is contained in:
@@ -757,7 +757,7 @@ abstract class Format
|
||||
case 'updateAuthMethod':
|
||||
switch ($param) {
|
||||
case 'methodId':
|
||||
return 'ProjetAuthMethodId';
|
||||
return 'ProjectAuthMethodId';
|
||||
}
|
||||
break;
|
||||
case 'getPolicy':
|
||||
|
||||
@@ -63,33 +63,4 @@ class FormatTest extends TestCase
|
||||
$this->assertSame('HealthCheckStatus', $this->format->getResponseEnumName('healthStatus', 'status'));
|
||||
$this->assertNull($this->format->getResponseEnumName('key', 'name'));
|
||||
}
|
||||
|
||||
public function testPlatformListIdUsesSharedPlatformTypeEnum(): void
|
||||
{
|
||||
$this->assertSame('PlatformType', $this->format->getResponseEnumName('platformList', '$id'));
|
||||
$this->assertNull($this->format->getResponseEnumName('platformList', 'name'));
|
||||
$this->assertNull($this->format->getResponseEnumName('other', '$id'));
|
||||
}
|
||||
|
||||
public function testEnumSDKNameOverrideTakesPrecedence(): void
|
||||
{
|
||||
$this->assertSame('AuthMethodId', $this->format->getResponseEnumName('projectAuthMethod', 'method', 'AuthMethodId'));
|
||||
|
||||
// Override wins even on models that have their own mapping.
|
||||
$this->assertSame('CustomName', $this->format->getResponseEnumName('platformAndroid', 'type', 'CustomName'));
|
||||
$this->assertSame('CustomName', $this->format->getResponseEnumName('healthStatus', 'status', 'CustomName'));
|
||||
|
||||
// Override produces an enum name for params that otherwise wouldn't get one.
|
||||
$this->assertSame('AuthMethodId', $this->format->getResponseEnumName('key', 'name', 'AuthMethodId'));
|
||||
}
|
||||
|
||||
public function testEnumSDKNameEmptyOrNullFallsThroughToDefaults(): void
|
||||
{
|
||||
$this->assertNull($this->format->getResponseEnumName('key', 'name', null));
|
||||
$this->assertNull($this->format->getResponseEnumName('key', 'name', ''));
|
||||
|
||||
// Falsy override should not block the existing platform mapping.
|
||||
$this->assertSame('PlatformType', $this->format->getResponseEnumName('platformWeb', 'type', null));
|
||||
$this->assertSame('PlatformType', $this->format->getResponseEnumName('platformWeb', 'type', ''));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user