From 8c6e84f8ae4548a5c895b010ce8bac144fac3121 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Wed, 4 Dec 2024 15:04:02 +0300 Subject: [PATCH] Updated CodeMethodWriter test file for php --- .../Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs index fe01e34e07..1dd307da19 100644 --- a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs @@ -1474,9 +1474,9 @@ public void WritesModelFactoryBodyForUnionModels() Assert.Contains("if ('#kiota.complexType1' === $mappingValue) {", result); Assert.Contains("$result->setComplexType1Value(new ComplexType1())", result); Assert.Contains("if ($parseNode->getStringValue() !== null) {", result); - Assert.Contains("$result->setStringValue($parseNode->getStringValue())", result); + Assert.Contains("$result->setStringValue($finalValue)", result); Assert.Contains("else if ($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']) !== null) {", result); - Assert.Contains("$result->setComplexType2Value($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']))", result); + Assert.Contains("$result->setComplexType2Value($finalValue)", result); Assert.Contains("return $result", result); Assert.DoesNotContain("return new UnionTypeWrapper()", result); AssertExtensions.Before("$parseNode->getStringValue()", "getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue'])", result);