예제 #1
0
 public function testBefore()
 {
     $this->eq(s::before('abc/def', '/'), 'abc');
     $this->eq(s::before('abc/def/ghi', '/'), 'abc');
     $this->eq(s::before('abc', '/'), 'abc');
     $this->eq(s::before('abcdef', ''), '');
     $this->eq(s::before('abcdef', 'abcdef'), '');
     $this->eq(s::before('abc', 'abcdef'), 'abc');
     $this->eq(s::before('', ''), '');
     $this->eq(s::before('', 'abc'), '');
 }
예제 #2
0
 public function before($substr)
 {
     return new self(s::before($this->value, self::unwrap($substr)));
 }