function it_applies_matching_formatters(ValueFormatter $formatterA, ValueFormatter $formatterB) { $formatterA->accepts(Argument::cetera())->willReturn(false); $formatterA->format(Argument::cetera())->shouldNotBeCalled(); $formatterB->accepts(Argument::cetera())->willReturn(true); $formatterB->format(Argument::cetera())->shouldBeCalled()->willReturn('bar'); $this->format('foo', 'test', [])->shouldReturn('bar'); }
/** * Format field options. * * @param string $field Field name. * @param array $values Field values. * @param mixed $context Data container object. * * @return array */ public function formatOptions($field, array $values, $context = null) { $definition = $this->definition->get(['fields', $field]); return $this->optionsFormatter->format($values, $field, $definition, $context); }