示例#1
0
 public function testIndexSearch()
 {
     $str = new Text('let it go');
     $this->assertEquals(4, $str->indexOf('it'));
     $this->assertEquals(4, $str->indexOf(new Text('it')));
 }
示例#2
0
 /**
  * Sets the full name (vendor/name) of the package
  *
  * @param string $name
  * @return $this
  */
 public function setFullName($name)
 {
     $fullName = new Text($name);
     $this->fullName = $name;
     $this->name = $fullName->substring($fullName->indexOf('/') + 1)->toString();
     $this->vendor = $fullName->substring(0, $fullName->indexOf('/'))->toString();
     return $this;
 }