예제 #1
0
 public function testValidStartsWith()
 {
     $s = new Stringizer("文字列のそれ");
     $this->assertEquals(true, $s->startsWith("文"));
     $s = new Stringizer("文字列のそれ");
     $this->assertEquals(false, $s->startsWith("文文文文"));
     $s = new Stringizer("Fizz Buzz");
     $this->assertEquals(true, $s->startsWith("Fizz B"));
 }
예제 #2
0
 public function execute()
 {
     $s = new Stringizer($this->getValue());
     if ($s->startsWith($this->prefix)) {
         return $this->getValue();
     } else {
         return $this->prefix . $this->getValue();
     }
 }