public function execute() { $s = new Stringizer($this->getValue()); if ($s->endsWith($this->suffix)) { return $this->getValue(); } else { return $this->getValue() . $this->suffix; } }
public function testValidStartsWith() { $s = new Stringizer("文字列のそれ"); $this->assertEquals(true, $s->endsWith("れ")); $s = new Stringizer("文字列のそれ"); $this->assertEquals(false, $s->endsWith("れれれれ")); $s = new Stringizer("Fizz Buzz"); $this->assertEquals(true, $s->endsWith("zz")); }