Пример #1
0
 public function testContainsCountValid()
 {
     $s = new Stringizer("fizz buzz foo bar");
     $this->assertEquals(1, $s->containsCount("buzz"));
     $s = new Stringizer("fizz buzz fizz buzz fizz buzz");
     $this->assertEquals(3, $s->containsCount("buzz"));
     $s = new Stringizer("fizz buzz foo bar");
     $this->assertEquals(0, $s->containsCount("nomatch"));
     // Case Sensitive, no match
     $s = new Stringizer("fizz buzz foo bar");
     $this->assertEquals(0, $s->containsCount("BUZZ"));
     $s = new Stringizer("fizz buzz foo bar");
     $this->assertEquals(1, $s->containsCountIncaseSensitive("BUZZ"));
     $s = new Stringizer("fizz buzz foo bar");
     $this->assertEquals(0, $s->containsCountIncaseSensitive("BUZZ-NO-MATCH"));
 }