Lines Matching refs:this

50         $this->handler = new FormErrorHandler(new Translator('en'));
51 $navigator = $this->getMockBuilder(GraphNavigatorInterface::class)->getMock();
53 $this->visitor = (new JsonSerializationVisitorFactory())->getVisitor($navigator, $context);
54 $this->dispatcher = new EventDispatcher();
55 … $this->factory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
60 $this->handler = null;
61 $this->visitor = null;
62 $this->dispatcher = null;
63 $this->factory = null;
68 $form = $this->createForm();
69 $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, []));
76 $this->handler = new FormErrorHandler();
77 $form = $this->createForm();
79 $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, []));
88 $form = $this->createForm();
90 $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, []));
119 $data = json_encode($this->handler->serializeFormToJson($this->visitor, $form, []));
134 $json = json_encode($this->handler->serializeFormToJson($this->visitor, $form, []));
148 …$translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(…
152 $translator->expects($this->once())
155 $this->equalTo('error!'),
156 $this->equalTo([]),
157 $this->equalTo('validators')
160 …$formError = $this->getMockBuilder('Symfony\Component\Form\FormError')->disableOriginalConstructor…
161 $formError->expects($this->once())->method('getMessageTemplate')->willReturn('error!');
162 $formError->expects($this->once())->method('getMessagePluralization')->willReturn(null);
163 $formError->expects($this->once())->method('getMessageParameters')->willReturn([]);
165 $this->invokeMethod($handler, 'getErrorMessage', [$formError]);
171 …$translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(…
175 $translator->expects($this->once())
178 $this->equalTo('error!'),
179 $this->equalTo(0),
180 $this->equalTo([]),
181 $this->equalTo('validators')
184 …$formError = $this->getMockBuilder('Symfony\Component\Form\FormError')->disableOriginalConstructor…
185 $formError->expects($this->once())->method('getMessageTemplate')->willReturn('error!');
186 $formError->expects($this->exactly(2))->method('getMessagePluralization')->willReturn(0);
187 $formError->expects($this->once())->method('getMessageParameters')->willReturn([]);
189 $this->invokeMethod($handler, 'getErrorMessage', [$formError]);
195 …$translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(…
199 $translator->expects($this->once())
202 $this->equalTo('error!'),
203 $this->equalTo([]),
204 $this->equalTo('custom_domain')
207 …$formError = $this->getMockBuilder('Symfony\Component\Form\FormError')->disableOriginalConstructor…
208 $formError->expects($this->once())->method('getMessageTemplate')->willReturn('error!');
209 $formError->expects($this->once())->method('getMessagePluralization')->willReturn(null);
210 $formError->expects($this->once())->method('getMessageParameters')->willReturn([]);
212 $this->invokeMethod($handler, 'getErrorMessage', [$formError]);
218 …$translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(…
222 $translator->expects($this->once())
225 $this->equalTo('error!'),
226 $this->equalTo(0),
227 $this->equalTo([]),
228 $this->equalTo('custom_domain')
231 …$formError = $this->getMockBuilder('Symfony\Component\Form\FormError')->disableOriginalConstructor…
232 $formError->expects($this->once())->method('getMessageTemplate')->willReturn('error!');
233 $formError->expects($this->exactly(2))->method('getMessagePluralization')->willReturn(0);
234 $formError->expects($this->once())->method('getMessageParameters')->willReturn([]);
236 $this->invokeMethod($handler, 'getErrorMessage', [$formError]);
248 return new FormBuilder($name, $dataClass, $dispatcher ?: $this->dispatcher, $this->factory);
258 $form = $this->getMockBuilder('Symfony\Component\Form\Test\FormInterface')->getMock();
259 $config = $this->getMockBuilder('Symfony\Component\Form\FormConfigInterface')->getMock();
261 $form->expects($this->any())
263 ->will($this->returnValue($name));
264 $form->expects($this->any())
266 ->will($this->returnValue($config));
273 return $this->getBuilder()->getForm();