public function testReplaceAll() { $str = new Str("Hello, world."); $count = 0; $this->assertTrue($str->replaceAll("/o/", "O", -1, $count)->equals("HellO, wOrld.")); $this->assertEquals($count, 2); }