Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Commit 1010eba

Browse files
committed
Test PhpObjectDictionary serialization.
1 parent 8c4b69c commit 1010eba

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

PhpSerializerNET.Test/Deserialize/Options/EmptyStringToDefault.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This Source Code Form is subject to the terms of the Mozilla Public
1010
using Microsoft.VisualStudio.TestTools.UnitTesting;
1111
using PhpSerializerNET.Test.DataTypes;
1212

13-
1413
namespace PhpSerializerNET.Test.Deserialize.Options {
1514
[TestClass]
1615
public class EmptyStringToDefaultTest {

PhpSerializerNET.Test/Serialize/IPhpObjectSerialization.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,15 @@ public void SerializeIPhpObject() {
1919
PhpSerialization.Serialize(data)
2020
);
2121
}
22+
23+
[TestMethod]
24+
public void SerializePhpObjectDictionary() {
25+
var data = new PhpObjectDictionary() { { "Foo", "" } };
26+
data.SetClassName("MyPhpObject");
27+
Assert.AreEqual( // strings:
28+
"O:11:\"MyPhpObject\":1:{s:3:\"Foo\";s:0:\"\";}",
29+
PhpSerialization.Serialize(data)
30+
);
31+
}
2232
}
2333
}

0 commit comments

Comments
 (0)