public function loadDefaults($container)
 {
     $loader = new YamlLoader($caontainer, new FileLocator(__DIR__ . '/../Resources/config'));
     foreach ($this->resources as $resource) {
         $loader->load($resource);
     }
 }
 /**
  * Load test
  */
 public function testLoad()
 {
     $file = __DIR__ . $this->alphabetFile;
     $alphabets = $this->loader->load($file);
     $this->assertInstanceOf('Ideea\\LanguageDetector\\Alphabet\\Storage', $alphabets);
     $this->assertCount(2, $alphabets);
     $enAlphabet = $alphabets->get('en');
     $this->assertEquals(array(65, 97, 66, 98, 67, 99), $enAlphabet->getCharCodes());
     $this->assertEquals(array(), $enAlphabet->getCommonCharCodes());
     $this->assertEquals(array(), $enAlphabet->getMultipleCharCodes());
     $esAlphabet = $alphabets->get('es');
     $this->assertEquals(array(65, 97, 66, 98, 67, 99), $esAlphabet->getCharCodes());
     $this->assertEquals(array(68, 100, 69, 101), $esAlphabet->getCommonCharCodes());
     $this->assertEquals(array(array(67, 104), array(99, 104), array(69, 115), array(101, 115)), $esAlphabet->getMultipleCharCodes());
 }
Exemple #3
0
 /**
  * Test loading a file
  */
 public function testLoadFile()
 {
     $result = $this->loader->load(CONFIGTEST_SUPPORT_PATH . '/test.yaml');
     $this->assertEquals($this->getTestData(), $result);
 }