/**
  * @expectedException \Symfony\Component\Serializer\Exception\LogicException
  * @expectedExceptionMessage Cannot normalize attribute "bar" because injected serializer is not a normalizer
  */
 public function testUnableToNormalizeObjectAttribute()
 {
     $serializer = $this->getMock('Symfony\\Component\\Serializer\\SerializerInterface');
     $this->normalizer->setSerializer($serializer);
     $obj = new PropertyDummy();
     $object = new \stdClass();
     $obj->setBar($object);
     $this->normalizer->normalize($obj, 'any');
 }
예제 #2
0
 public function testIgnoredAttributes()
 {
     $this->normalizer->setIgnoredAttributes(array('foo', 'bar', 'camelCase'));
     $obj = new PropertyDummy();
     $obj->foo = 'foo';
     $obj->setBar('bar');
     $this->assertEquals(array(), $this->normalizer->normalize($obj, 'any'));
 }