Skip to content

Commit

Permalink
Replaced the enclosing of enum values from single to double quotes. T…
Browse files Browse the repository at this point in the history
…his accomodates values with apostrophe
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Nov 13, 2024
1 parent 2292e43 commit d472aeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Php/CodeEnumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void WriteCodeElement(CodeEnum codeElement, LanguageWriter write
writer.IncreaseIndent();
foreach (var enumProperty in enumProperties)
{
writer.WriteLine($"public const {GetEnumValueName(enumProperty.Name)} = '{enumProperty.WireName}';");
writer.WriteLine($"public const {GetEnumValueName(enumProperty.Name)} = \"{enumProperty.WireName}\";");
}
}
[GeneratedRegex(@"([A-Z]{1})", RegexOptions.Singleline, 500)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task WritesEnumAsync()
Assert.Contains("use Microsoft\\Kiota\\Abstractions\\Enum", result);
Assert.Contains("class", result);
Assert.Contains("extends Enum", result);
Assert.Contains($"public const {optionName.ToUpperInvariant()} = '{optionName}'", result);
Assert.Contains($"public const {optionName.ToUpperInvariant()} = \"{optionName}\"", result);
AssertExtensions.CurlyBracesAreClosed(result, 1);
Assert.Contains(optionName, result);
}
Expand Down

0 comments on commit d472aeb

Please sign in to comment.