diff --git a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs index 1dd307da19..ad5c54b056 100644 --- a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs @@ -1474,8 +1474,10 @@ 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("$finalValue = $parseNode->getStringValue()", result); Assert.Contains("$result->setStringValue($finalValue)", result); Assert.Contains("else if ($parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue']) !== null) {", result); + Assert.Contains("$finalValue = $parseNode->getCollectionOfObjectValues([ComplexType2::class, 'createFromDiscriminatorValue'])", result); Assert.Contains("$result->setComplexType2Value($finalValue)", result); Assert.Contains("return $result", result); Assert.DoesNotContain("return new UnionTypeWrapper()", result);