1--TEST--
2Test soundex() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing str_rot13() : basic functionality ***\n";
6
7echo "\nBasic tests\n";
8var_dump(str_rot13("str_rot13() tests starting"));
9var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz"));
10
11echo "\nEnsure numeric characters are left untouched\n";
12if (strcmp(str_rot13("0123456789"), "0123456789") == 0) {
13    echo "Strings equal : TEST PASSED\n";
14} else {
15    echo "Strings unequal : TEST FAILED\n";
16}
17
18echo "\nEnsure non-alphabetic characters are left untouched\n";
19if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) {
20    echo "Strings equal : TEST PASSED\n";
21} else {
22    echo "Strings unequal : TEST FAILED\n";
23}
24
25echo "\nEnsure strings round trip\n";
26$str = "str_rot13() tests starting";
27$encode = str_rot13($str);
28$decode = str_rot13($encode);
29if (strcmp($str, $decode) == 0) {
30    echo "Strings equal : TEST PASSED\n";
31} else {
32    echo "Strings unequal : TEST FAILED\n";
33}
34?>
35--EXPECT--
36*** Testing str_rot13() : basic functionality ***
37
38Basic tests
39string(26) "fge_ebg13() grfgf fgnegvat"
40string(26) "nopqrstuvwxyzabcdefghijklm"
41
42Ensure numeric characters are left untouched
43Strings equal : TEST PASSED
44
45Ensure non-alphabetic characters are left untouched
46Strings unequal : TEST FAILED
47
48Ensure strings round trip
49Strings equal : TEST PASSED
50