function testBrr() { $str = 'a+(b+(c+1))'; $brr = new Brr(); $substituted = $brr->sub($str); $this->assertEqual($substituted, 'a+([0]b+([1]c+1)[1])[0]'); $substituted = str_replace('a', 'A', $substituted); $substituted = str_replace('b', 'B', $substituted); $substituted = str_replace('c', 'C', $substituted); $substituted = $brr->subback($substituted); $this->assertEqual($substituted, 'A+(B+(C+1))'); }