ComplexDataNormalizer example


  protected $normalizer;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->normalizer = new ComplexDataNormalizer();
  }

  /** * @covers ::supportsNormalization */
  public function testSupportsNormalization() {
    $complex_data = $this->prophesize(ComplexDataInterface::class)->reveal();
    $this->assertTrue($this->normalizer->supportsNormalization($complex_data));
    // Also test that an object not implementing ComplexDataInterface fails.     $this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
  }

  
Home | Imprint | This part of the site doesn't use cookies.