public function stringTestChar()
 {
     $s = new String('Übercoder', 'iso-8859-1');
     $this->assertTrue(isset($s[0]));
     $this->assertTrue(isset($s[$s->length() - 1]));
     $this->assertFalse(isset($s[$s->length()]));
     $this->assertFalse(isset($s[-1]));
 }
Ejemplo n.º 2
0
 public function offsetUnsetAtEnd()
 {
     $str = new String('www.müller.com');
     unset($str[$str->length() - 1]);
     $this->assertEquals(new String('www.müller.co'), $str);
 }
Ejemplo n.º 3
0
 public function queryTreeWithDefaultEncoding()
 {
     $value = new String('value öäü', 'utf-8');
     $xpath = new XPath($s = sprintf('<document><node>%s</node></document>', $value->getBytes('utf-8')));
     $this->assertEquals($value, new String($xpath->query('string(/document/node)'), 'utf-8'));
 }