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