Exemple #1
0
 public function setMap(array $map)
 {
     parent::setMap(['n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm']);
     return $this;
 }
Exemple #2
0
 public function testShouldDecryptStringCorrectly2()
 {
     $cipher = new Caesar();
     $map = ['d', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c'];
     $cipher->setMap($map);
     $actual = $cipher->decrypt(strtolower('D OLJHLUD UDSRVD PDUURP VDOWRX VREUH R FDFKRUUR FDQVDGR'));
     $expected = 'a ligeira raposa marrom saltou sobre o cachorro cansado';
     $this->assertEquals($expected, $actual);
 }