You are here

public function PropertyNormalizerTest::testUnableToNormalizeObjectAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php \Symfony\Component\Serializer\Tests\Normalizer\PropertyNormalizerTest::testUnableToNormalizeObjectAttribute()

@expectedException \Symfony\Component\Serializer\Exception\LogicException @expectedExceptionMessage Cannot normalize attribute "bar" because injected serializer is not a normalizer

File

vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php, line 416

Class

PropertyNormalizerTest

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

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');
}