Ejemplo n.º 1
0
 /**
  * Resolve the given link.
  *
  * @param  string $link
  * @return string
  */
 protected function resolveLink($link)
 {
     if (Str::startsWith('http', $link, false)) {
         return $link;
     } else {
         $path = Str::endsWith($link, '.md', false) ? Str::remove($link, '.md') : $link;
         return $this->project->getFactory()->url($this->project, $this->project->getRef(), $path);
     }
 }
Ejemplo n.º 2
0
 public function testCanAssertAStringStartsWith()
 {
     $this->assertTrue(Str::startsWith('foobar', 'foo'));
     $this->assertFalse(Str::startsWith('barfoo', 'foo'));
 }