/**
  * {@inheritdoc}
  */
 public function createNew()
 {
     $resource = $this->factory->createNew();
     if (!$resource instanceof TranslatableInterface) {
         throw new UnexpectedTypeException($resource, TranslatableInterface::class);
     }
     $resource->setCurrentLocale($this->localeProvider->getCurrentLocale());
     $resource->setFallbackLocale($this->localeProvider->getFallbackLocale());
     return $resource;
 }
 function it_creates_translatable_and_sets_locales(FactoryInterface $factory, LocaleProviderInterface $localeProvider, SampleTranslatableResource $resource)
 {
     $localeProvider->getCurrentLocale()->willReturn('pl_PL');
     $localeProvider->getFallbackLocale()->willReturn('en_GB');
     $factory->createNew()->willReturn($resource);
     $resource->setCurrentLocale('pl_PL')->shouldBeCalled();
     $resource->setFallbackLocale('en_GB')->shouldBeCalled();
     $this->createNew()->shouldReturn($resource);
 }