@@ -136,13 +136,34 @@ public function testDeserializeWrongNormalizer()
136
136
/**
137
137
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
138
138
*/
139
- public function testDeerializeNoEncoder ()
139
+ public function testDeserializeNoEncoder ()
140
140
{
141
141
$ this ->serializer = new Serializer (array (), array ());
142
142
$ data = array ('title ' => 'foo ' , 'numbers ' => array (5 , 3 ));
143
143
$ this ->serializer ->deserialize (json_encode ($ data ), '\Symfony\Tests\Component\Serializer\Model ' , 'json ' );
144
144
}
145
145
146
+ public function testDeserializeSupported ()
147
+ {
148
+ $ this ->serializer = new Serializer (array (new GetSetMethodNormalizer ()), array ());
149
+ $ data = array ('title ' => 'foo ' , 'numbers ' => array (5 , 3 ));
150
+ $ this ->assertTrue ($ this ->serializer ->supportsDenormalization (json_encode ($ data ), '\Symfony\Tests\Component\Serializer\Model ' , 'json ' ));
151
+ }
152
+
153
+ public function testDeserializeNotSupported ()
154
+ {
155
+ $ this ->serializer = new Serializer (array (new GetSetMethodNormalizer ()), array ());
156
+ $ data = array ('title ' => 'foo ' , 'numbers ' => array (5 , 3 ));
157
+ $ this ->assertFalse ($ this ->serializer ->supportsDenormalization (json_encode ($ data ), 'stdClass ' , 'json ' ));
158
+ }
159
+
160
+ public function testDeserializeNotSupportedMissing ()
161
+ {
162
+ $ this ->serializer = new Serializer (array (), array ());
163
+ $ data = array ('title ' => 'foo ' , 'numbers ' => array (5 , 3 ));
164
+ $ this ->assertFalse ($ this ->serializer ->supportsDenormalization (json_encode ($ data ), '\Symfony\Tests\Component\Serializer\Model ' , 'json ' ));
165
+ }
166
+
146
167
public function testEncode ()
147
168
{
148
169
$ this ->serializer = new Serializer (array (), array ('json ' => new JsonEncoder ()));
0 commit comments