public function testGenerate()
 {
     $dictionaryPath = 'dictionary_path';
     $packPath = 'pack_path';
     $localeString = 'locale';
     $mode = 'mode';
     $allowDuplicates = true;
     $localeMock = $this->getMock('Magento\\Tools\\I18n\\Locale', [], [], '', false);
     $phrases = [$this->getMock('Magento\\Tools\\I18n\\Dictionary\\Phrase', [], [], '', false)];
     $this->dictionaryMock->expects($this->once())->method('getPhrases')->will($this->returnValue([$phrases]));
     $this->factoryMock->expects($this->once())->method('createLocale')->with($localeString)->will($this->returnValue($localeMock));
     $this->dictionaryLoaderMock->expects($this->once())->method('load')->with($dictionaryPath)->will($this->returnValue($this->dictionaryMock));
     $this->packWriterMock->expects($this->once())->method('write')->with($this->dictionaryMock, $packPath, $localeMock, $mode);
     $this->_generator->generate($dictionaryPath, $packPath, $localeString, $mode, $allowDuplicates);
 }