/**
* Tests the getName function of the Holiday object with global translations and an overriding custom translation.
*/
public function testHolidayGetNameWithOverridenGlobalTranslations()
{
/** @var TranslationsInterface|PHPUnit_Framework_MockObject_MockObject $translationsStub */
$translationsStub = $this->getMockBuilder('\\Yasumi\\TranslationsInterface')->getMock();
$translations = ['en_US' => 'New Year\'s Day', 'pl_PL' => 'Nowy Rok'];
$translationsStub->expects($this->once())->method('getTranslations')->with($this->equalTo('newYearsDay'))->willReturn($translations);
$customLocale = 'pl_PL';
$customTranslation = 'Bardzo Nowy Rok';
$holiday = new Holiday('newYearsDay', [$customLocale => $customTranslation], new DateTime("2014-01-01"), $customLocale);
$holiday->mergeGlobalTranslations($translationsStub);
$this->assertNotNull($holiday->getName());
$this->assertInternalType('string', $holiday->getName());
$this->assertEquals($customTranslation, $holiday->getName());
}