Example #1
0
 public function testPreceding()
 {
     $this->eq(s::preceding('abcdef', 'c'), 'ab');
     $this->eq(s::preceding('abcdef', 'x'), null);
     $this->eq(s::preceding('abcdef', 'de'), 'abc');
     $this->eq(s::preceding('abcdef', ''), '');
 }
Example #2
0
 public function preceding($substr)
 {
     return self::_wrap(s::preceding($this->value, self::unwrap($substr)));
 }