Ejemplo n.º 1
0
 /**
  * test setLocale
  * expected true
  */
 public function testsetLocale()
 {
     $value = new Zend_LocaleTestHelper('de_DE');
     $value->setLocale('en_US');
     $this->assertEquals('en_US', $value->toString());
     $value->setLocale('en_AA');
     $this->assertEquals('en', $value->toString());
     $value->setLocale('xx_AA');
     $this->assertEquals('root', $value->toString());
     $value->setLocale('auto');
     $this->assertTrue(is_string($value->toString()));
     try {
         $value->setLocale('browser');
         $this->assertTrue(is_string($value->toString()));
     } catch (Zend_Locale_Exception $e) {
         // ignore environments where the locale can not be detected
         $this->assertContains('Autodetection', $e->getMessage());
     }
     try {
         $value->setLocale('environment');
         $this->assertTrue(is_string($value->toString()));
     } catch (Zend_Locale_Exception $e) {
         // ignore environments where the locale can not be detected
         $this->assertContains('Autodetection', $e->getMessage());
     }
 }