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'), ''); }
public function before($substr) { return new self(s::before($this->value, self::unwrap($substr))); }