コード例 #1
0
 function it_updates_channel($repository, $saver, $completeness, GenericEvent $event, ChannelInterface $channel, LocaleInterface $localeEn, LocaleInterface $localeFr, LocaleInterface $localeEs)
 {
     $event->getSubject()->willReturn($channel);
     $repository->getDeletedLocalesForChannel($channel)->willReturn([$localeEn]);
     $completeness->scheduleForChannelAndLocale($channel, $localeEn)->shouldBeCalled();
     $localeFr->hasChannel($channel)->willReturn(true);
     $localeEs->hasChannel($channel)->willReturn(false);
     $channel->getLocales()->willReturn([$localeFr, $localeEs]);
     $channel->hasLocale($localeEn)->willReturn(false);
     $channel->hasLocale($localeFr)->willReturn(true);
     $localeEn->removeChannel($channel)->shouldBeCalled();
     $localeEs->addChannel($channel)->shouldBeCalled();
     $saver->saveAll([$localeEn, $localeEs])->shouldBeCalled();
     $this->updateChannel($event);
 }