public function testHyphenatorInvocationWithoutFactory()
 {
     $o = new \Org\Heigl\Hyphenator\Options();
     $o->setHyphen('-')->setDefaultLocale('de_DE')->setRightMin(2)->setLeftMin(2)->setWordMin(5)->setFilters('Simple')->setTokenizers('Whitespace', 'Punctuation');
     \Org\Heigl\Hyphenator\Dictionary\Dictionary::setFileLocation(__DIR__ . '/share/test3/files/dictionaries/');
     $h = new \Org\Heigl\Hyphenator\Hyphenator();
     $h->setOptions($o);
     $this->assertEquals('We have some re-al-ly long words in ger-man like sau-er-stoff-feld-fla-sche.', $h->hyphenate('We have some really long words in german like sauerstofffeldflasche.'));
 }
 public function testParsingDicFilesWorks()
 {
     Dictionary::setFileLocation(__DIR__ . '/share/');
     @unlink(__DIR__ . '/share/de_TE.ini');
     $dict = Dictionary::parseFile('de_TE');
     $this->assertTrue(file_Exists($dict));
     $this->assertTrue('UTF-8' == mb_detect_encoding(file_get_contents($dict)));
     $this->assertEquals(file_get_contents(__DIR__ . '/share/de_TE.default.ini'), file_get_contents($dict));
     try {
         $dict = Dictionary::parseFile('foobar');
         $this->fail('This should have raised an exception!');
     } catch (\Org\Heigl\Hyphenator\Exception\PathNotFoundException $exception) {
         $this->assertTrue(true);
     }
 }
 /**
  * Add a Dictionary to the Hyphenator
  *
  * @param \Org\Heigl\Hyphenator\Dictionary\Dictionary $dictionary The
  * Dictionary wit hyphenation-Patterns to add to this Hyphenator
  *
  * @return Org\Heigl\Hyphenator\Hyphenator
  */
 public function addDictionary($dictionary)
 {
     if (!$dictionary instanceof \Org\Heigl\Hyphenator\Dictionary\Dictionary) {
         \Org\Heigl\Hyphenator\Dictionary\Dictionary::setFileLocation($this->getHomePath() . '/files/dictionaries');
         $dictionary = \Org\Heigl\Hyphenator\Dictionary\Dictionary::factory($dictionary);
     }
     $this->_dicts->add($dictionary);
     return $this;
 }