eZ\Publish\Core\Helper\Tests\TranslationHelperTest::testGetTranslatedNameByContentInfo PHP Method

testGetTranslatedNameByContentInfo() public method

public testGetTranslatedNameByContentInfo ( array $prioritizedLanguages, string $expectedLocale )
$prioritizedLanguages array
$expectedLocale string
    public function testGetTranslatedNameByContentInfo(array $prioritizedLanguages, $expectedLocale)
    {
        $versionInfo = $this->generateVersionInfo();
        $contentInfo = new ContentInfo(array('id' => 123));
        $this->configResolver->expects($this->once())->method('getParameter')->with('languages')->will($this->returnValue($prioritizedLanguages));
        $this->contentService->expects($this->once())->method('loadVersionInfo')->with($contentInfo)->will($this->returnValue($versionInfo));
        $this->assertSame($this->translatedNames[$expectedLocale], $this->translationHelper->getTranslatedContentNameByContentInfo($contentInfo));
    }