function it_configures_options(OptionsResolver $resolver, ZoneInterface $zone, RepositoryInterface $repository)
 {
     $zone->getCode()->willReturn('EU');
     $zone->getName()->willReturn('European Union');
     $repository->findAll()->willReturn([$zone]);
     $resolver->setDefaults(['choice_translation_domain' => false, 'choices' => ['EU' => 'European Union'], 'label' => 'sylius.form.zone.types.zone', 'empty_value' => 'sylius.form.zone.select'])->willReturn($resolver);
     $this->configureOptions($resolver);
 }
Exemplo n.º 2
0
 function it_configures_options(OptionsResolver $resolver, ZoneInterface $zone, RepositoryInterface $repository)
 {
     $zone->getCode()->willReturn('EU');
     $zone->getName()->willReturn('European Union');
     $repository->findAll()->willReturn(array($zone));
     $resolver->setDefaults(array('choices' => array('EU' => 'European Union'), 'label' => 'sylius.form.zone.types.zone', 'empty_value' => 'sylius.form.zone.select'))->willReturn($resolver);
     $this->configureOptions($resolver);
 }
Exemplo n.º 3
0
 function it_returns_zone_name(ZoneInterface $zone)
 {
     $zone->getName()->willReturn('USA');
     $this->setZone($zone);
     $this->getName()->shouldReturn('USA');
 }
Exemplo n.º 4
0
 /**
  * @param ZoneInterface $zone
  * @param ZoneMemberInterface $zoneMember
  *
  * @throws \InvalidArgumentException
  */
 private function assertZoneAndItsMember(ZoneInterface $zone, ZoneMemberInterface $zoneMember)
 {
     Assert::true($this->updatePage->hasResourceValues(['code' => $zone->getCode(), 'name' => $zone->getName()]), sprintf('Zone %s is not valid', $zone->getName()));
     Assert::true($this->updatePage->hasMember($zoneMember), sprintf('Zone %s has not %s zone member', $zone->getName(), $zoneMember->getCode()));
 }