Beispiel #1
0
 /**
  * Tests the normalize() method.
  */
 public function testNormalize()
 {
     $serializer = $this->getMockBuilder('Symfony\\Component\\Serializer\\Serializer')->setMethods(array('normalize'))->getMock();
     $serializer->expects($this->exactly(3))->method('normalize')->will($this->returnValue('test'));
     $this->normalizer->setSerializer($serializer);
     $normalized = $this->normalizer->normalize($this->list);
     $this->assertEquals($this->expectedListValues, $normalized);
 }
  /**
   * Tests the normalize() method.
   */
  public function testNormalize() {
    $serializer = $this->prophesize(Serializer::class);
    $serializer->normalize($this->typedData, 'json', ['mu' => 'nu'])
      ->shouldBeCalledTimes(3)
      ->willReturn('test');

    $this->normalizer->setSerializer($serializer->reveal());

    $normalized = $this->normalizer->normalize($this->list, 'json', ['mu' => 'nu']);

    $this->assertEquals($this->expectedListValues, $normalized);
  }