Beispiel #1
0
 public function testRender()
 {
     $this->propertyAccessor->expects($this->once())->method('getValue')->with($this->identicalTo($data = new \stdClass()), $this->identicalTo($path = 'path_value'))->will($this->returnValue($number = 123.456));
     $this->formatter->expects($this->once())->method('format')->with($this->identicalTo($number), $this->identicalTo($options = ['path' => $path, 'scale' => 4, 'grouping' => true, 'rounding' => \NumberFormatter::ROUND_HALFDOWN]))->will($this->returnValue($result = '123,45'));
     $this->assertSame($result, $this->type->render($data, $options));
 }
Beispiel #2
0
 public function testRender()
 {
     $this->propertyAccessor->expects($this->once())->method('getValue')->with($this->identicalTo($data = new \stdClass()), $this->identicalTo($path = 'path_value'))->will($this->returnValue($dateTime = new \DateTime($date = date($format = 'Y-m-d H:i:s'))));
     $this->formatter->expects($this->once())->method('format')->with($this->identicalTo($dateTime), $this->identicalTo($options = ['path' => $path]))->will($this->returnValue($result = $date));
     $this->assertSame($date, $this->type->render($data, $options));
 }