summaryrefslogtreecommitdiff
path: root/ext/hash/tests/joaat.phpt
blob: fa310a96e2bfa3aa265d9594618b0d62f6082cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Jenkins's one-at-a-time
--SKIPIF--
<?php extension_loaded('hash') or die ('Skip - hash extension not available'); ?>
--FILE--
<?php
$tests = array(
	array("hello world", "3e4a5a57"),
	array("", 0),
	array("", "000000"),
	array("a", "ca2e9442"),
	array("aa", "7081738e"),
);

$i = 0;
$pass = true;

foreach ($tests as $test) {
	++$i;
	
	$result = hash("joaat", $test[0]);
	if ($result != $test[1]) {
		echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n";

		$pass = false;
	}
}

if($pass) {
    echo "PASS";
}
?>
--EXPECT--
PASS