Ejemplo n.º 1
0
 /**
  * test getBrowser
  * expected true
  */
 public function testgetBrowser()
 {
     Zend_LocaleTestHelper::resetObject();
     $value = new Zend_LocaleTestHelper();
     $list = $value->getBrowser();
     if (empty($list)) {
         $this->markTestSkipped('Browser autodetection not possible in current environment');
     }
     $this->assertTrue(isset($list['de']));
     $this->assertEquals(array('de' => 1, 'en_UK' => 0.5, 'en_US' => 0.5, 'en' => 0.5, 'fr_FR' => 0.2, 'fr' => 0.2), $list);
     Zend_LocaleTestHelper::resetObject();
     putenv("HTTP_ACCEPT_LANGUAGE=");
     $value = new Zend_LocaleTestHelper();
     $list = $value->getBrowser();
     $this->assertEquals(array(), $list);
 }
Ejemplo n.º 2
0
 /**
  * test getBrowser
  * expected true
  */
 public function testgetBrowser()
 {
     Zend_LocaleTestHelper::resetObject();
     putenv("HTTP_ACCEPT_LANGUAGE=,de,en-UK-US;q=0.5,fr_FR;q=0.2");
     $value = new Zend_LocaleTestHelper();
     $list = $value->getBrowser();
     $this->assertTrue(isset($list['de']));
 }