summaryrefslogtreecommitdiff
path: root/tests/strings
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-02-03 22:52:20 +0100
commitf8d795820e780a6322e054c26c581570613c14f0 (patch)
tree99d3ae01ce564752807341c5743863b4c92513f8 /tests/strings
parentd2cb200e10ada6fa44c54a29292bb4665728fff0 (diff)
downloadphp-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz
Reindent phpt files
Diffstat (limited to 'tests/strings')
-rw-r--r--tests/strings/001.phpt78
-rw-r--r--tests/strings/bug26703.phpt2
2 files changed, 40 insertions, 40 deletions
diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt
index 6d0a9d12b9..0f1f749459 100644
--- a/tests/strings/001.phpt
+++ b/tests/strings/001.phpt
@@ -11,15 +11,15 @@ $tok2 = strtok("/");
$tok3 = strtok("\\");
$tok4 = strtok(".");
if ($tok1 != "testing") {
- echo("failed 1\n");
+ echo("failed 1\n");
} elseif ($tok2 != "1") {
- echo("failed 2\n");
+ echo("failed 2\n");
} elseif ($tok3 != "2") {
- echo("failed 3\n");
+ echo("failed 3\n");
} elseif ($tok4 != "3") {
- echo("failed 4\n");
+ echo("failed 4\n");
} else {
- echo("passed\n");
+ echo("passed\n");
}
echo "Testing strstr: ";
@@ -27,11 +27,11 @@ $test = "This is a test";
$found1 = strstr($test, chr(32));
$found2 = strstr($test, "a ");
if ($found1 != " is a test") {
- echo("failed 1\n");
+ echo("failed 1\n");
} elseif ($found2 != "a test") {
- echo("failed 2\n");
+ echo("failed 2\n");
} else {
- echo("passed\n");
+ echo("passed\n");
}
echo "Testing strrchr: ";
@@ -39,30 +39,30 @@ $test = "fola fola blakken";
$found1 = strrchr($test, "b");
$found2 = strrchr($test, chr(102));
if ($found1 != "blakken") {
- echo("failed 1\n");
+ echo("failed 1\n");
} elseif ($found2 != "fola blakken") {
- echo("failed 2\n");
+ echo("failed 2\n");
}
else {
- echo("passed\n");
+ echo("passed\n");
}
echo "Testing strtoupper: ";
$test = "abCdEfg";
$upper = strtoupper($test);
if ($upper == "ABCDEFG") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing strtolower: ";
$test = "ABcDeFG";
$lower = strtolower($test);
if ($lower == "abcdefg") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing substr: ";
@@ -79,9 +79,9 @@ $tests++; if (substr($string, -1, -2) == "") { $ok++; }
$tests++; if (substr($string, -3, -2) == "3") { $ok++; }
if ($tests == $ok) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
$raw = ' !"#$%&\'()*+,-./0123456789:;<=>?'
@@ -96,17 +96,17 @@ $correct = '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3
. '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~'
. '%00';
if ($encoded == $correct) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing rawurldecode: ";
$decoded = rawurldecode($correct);
if ($decoded == $raw) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing urlencode: ";
@@ -116,62 +116,62 @@ $correct = '+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%
. '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E'
. '%00';
if ($encoded == $correct) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing urldecode: ";
$decoded = urldecode($correct);
if ($decoded == $raw) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing quotemeta: ";
$raw = "a.\\+*?" . chr(91) . "^" . chr(93) . "b\$c";
$quoted = quotemeta($raw);
if ($quoted == "a\\.\\\\\\+\\*\\?\\[\\^\\]b\\\$c") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing ufirst: ";
$str = "fahrvergnuegen";
$uc = ucfirst($str);
if ($uc == "Fahrvergnuegen") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing strtr: ";
$str = "test abcdefgh";
$tr = strtr($str, "def", "456");
if ($tr == "t5st abc456gh") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing addslashes: ";
$str = "\"\\'";
$as = addslashes($str);
if ($as == "\\\"\\\\\\'") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing stripslashes: ";
$str = "\$\\'";
$ss = stripslashes($str);
if ($ss == "\$'") {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
@@ -183,9 +183,9 @@ $ui2 = uniqid($str, true);
$len = 29;
if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
echo "Testing uniqid(false): ";
@@ -197,9 +197,9 @@ $ui2 = uniqid($str);
$len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29;
if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) {
- echo("passed\n");
+ echo("passed\n");
} else {
- echo("failed!\n");
+ echo("failed!\n");
}
?>
diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt
index bea8fb1214..4e48845fdf 100644
--- a/tests/strings/bug26703.phpt
+++ b/tests/strings/bug26703.phpt
@@ -8,7 +8,7 @@ highlight.default=#0000BB
highlight.html=#000000
--FILE--
<?php
- highlight_string('<?php echo "foo[] $a \n"; ?>');
+ highlight_string('<?php echo "foo[] $a \n"; ?>');
?>
--EXPECT--
<code><span style="color: #000000">