Beispiel #1
0
 public function testTranslatorIsPassedToField_SetAfterAddingTheField()
 {
     $translator = $this->getMock('Symfony\\Component\\I18N\\TranslatorInterface');
     $field = $this->getMock('Symfony\\Component\\Form\\Field', array(), array(), '', false, false);
     $field->expects($this->any())->method('getKey')->will($this->returnValue('firstName'));
     $field->expects($this->once())->method('setTranslator')->with($this->equalTo($translator));
     $group = new FieldGroup('author');
     $group->add($field);
     $group->setTranslator($translator);
 }