Exemple #1
0
 public function testDefaultTranslatorCanBeSet()
 {
     $translator = $this->getMock('Symfony\\Component\\I18N\\TranslatorInterface');
     Form::setDefaultTranslator($translator);
     $form = new Form('author', new Author(), $this->validator);
     $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));
     $form->add($field);
 }