static::
assertSame((string) $dalProduct->
getTranslation('name'
),
$esProduct['name'
][Defaults::LANGUAGE_SYSTEM
]);
static::
assertSame((string) $dalProduct->
getTranslation('description'
),
$esProduct['description'
][Defaults::LANGUAGE_SYSTEM
]);
static::
assertSame($dalProduct->
getTranslation('customFields'
),
$esProduct['customFields'
][Defaults::LANGUAGE_SYSTEM
]);
} else { static::
assertSame((string) $dalProduct->
getTranslation('name'
),
$esProduct['name'
]);
static::
assertSame((string) $dalProduct->
getTranslation('description'
),
$esProduct['description'
]);
static::
assertSame($dalProduct->
getTranslation('customFields'
),
$esProduct['customFields'
]);
} // Fetch: Second language
$languageContext =
new Context(new SystemSource(),
[], Defaults::CURRENCY,
[$ids->
get('language-1'
), Defaults::LANGUAGE_SYSTEM
]);
$languageContext->
addExtensions($context->
getExtensions());
$esProducts =
$this->definition->
fetch([$dal1],
$languageContext);
$esProduct =
$esProducts[$ids->
get('dal-1'
)];
$criteria =
new Criteria([$ids->
get('dal-1'
)]);
$dalProduct =
$this->productRepository->
search($criteria,
$languageContext)->
first();
static::
assertInstanceOf(ProductEntity::
class,
$dalProduct);
if (Feature::
isActive('ES_MULTILINGUAL_INDEX'
)) { static::
assertSame((string) $dalProduct->
getTranslation('name'
),
$esProduct['name'
][$ids->
get('language-1'
)]);
static::
assertSame((string) $dalProduct->
getTranslation('description'
),
$esProduct['description'
][$ids->
get('language-1'
)]);