File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
samples/client/petstore/php/SwaggerClient-php/tests Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 5
5
// test object serializer
6
6
class ObjectSerializerTest extends \PHPUnit_Framework_TestCase
7
7
{
8
+ /**
9
+ * Test the sanitizeForSerialization method with a stdClass.
10
+ */
11
+ public function testSanitizeForSerializationWithStdClass ()
12
+ {
13
+ // Initialize the ObjectSerializer.
14
+ $ s = new ObjectSerializer ();
15
+
16
+ // Build a stdClass object.
17
+ $ obj = new \stdClass ();
18
+ $ obj ->prop1 = 'val1 ' ;
19
+ $ obj ->prop2 = 'val2 ' ;
20
+
21
+ // Call the method.
22
+ $ serialized = $ s ->sanitizeForSerialization ($ obj );
23
+
24
+ // Assert that the stdClass object is sanitized as expected.
25
+ $ this ->assertEquals ('val1 ' , $ serialized ->prop1 );
26
+ $ this ->assertEquals ('val2 ' , $ serialized ->prop2 );
27
+ }
28
+
8
29
// test sanitizeFilename
9
30
public function testSanitizeFilename ()
10
31
{
You can’t perform that action at this time.
0 commit comments