getRequestParameterConfig($optional, $nullable, $default, $methodName, $paramName); } } class FormatTest extends TestCase { private TestFormat $format; protected function setUp(): void { parent::setUp(); $this->format = new TestFormat(new Container(), [], [], [], [], 0, 'console'); } public function testProjectRequestParameterOverrides(): void { $createWebPlatform = $this->format->requestParameterConfig(true, false, '', 'project.createWebPlatform', 'hostname'); $updateWebPlatform = $this->format->requestParameterConfig(true, false, '', 'project.updateWebPlatform', 'hostname'); $listPlatforms = $this->format->requestParameterConfig(true, false, [], 'project.listPlatforms', 'queries'); $this->assertTrue($createWebPlatform['required']); $this->assertFalse($createWebPlatform['emitDefault']); $this->assertTrue($updateWebPlatform['required']); $this->assertFalse($updateWebPlatform['emitDefault']); $this->assertTrue($listPlatforms['emitDefault']); } public function testProjectPlatformResponseTypeUsesSharedEnumMetadata(): void { $models = [ new PlatformAndroid(), new PlatformWeb(), new PlatformApple(), new PlatformWindows(), new PlatformLinux(), ]; foreach ($models as $model) { $this->assertSame('PlatformType', $model->getRules()['type']['enumSDKName']); } $this->assertArrayNotHasKey('enumSDKName', (new PlatformList())->getRules()['platforms']); } public function testExistingResponseEnumMetadataRemainsUnchanged(): void { $this->assertSame('HealthCheckStatus', (new HealthStatus())->getRules()['status']['enumSDKName']); } }