function it_throws_an_exception_if_method_not_exists(TranslatableInterface $translatable, AttributeTranslation $english, AttributeTranslation $french, AttributeTranslation $german) { $translatable->getTranslations()->willReturn([$english, $french, $german]); $english->getLocale()->willReturn('en_US'); $english->getLabel()->willReturn('foo'); $french->getLocale()->willReturn('fr_FR'); $french->getLabel()->willReturn('bar'); $german->getLocale()->willReturn('de_DE'); $german->getLabel()->willReturn('baz'); $this->shouldThrow('\\LogicException')->duringNormalize($translatable, 'csv', ['locales' => [], 'property' => 'unknown_property']); }
function it_ignores_a_locale_if_property_does_not_exist_for_a_translation(TranslatableInterface $translatable, AttributeTranslation $english, AttributeTranslation $french) { $translatable->getTranslations()->willReturn([$english, $french]); $this->normalize($translatable, 'xml', ['property' => 'description', 'locales' => ['en_US', 'de_DE', 'fr_FR', 'fr_BE']])->shouldReturn(['description' => ['en_US' => '', 'de_DE' => '', 'fr_FR' => '', 'fr_BE' => '']]); }