unit tests and base code
[ga4php.git] / unittests / createkey.php
diff --git a/unittests/createkey.php b/unittests/createkey.php
new file mode 100644 (file)
index 0000000..251132e
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+require_once("../lib/lib.php");
+
+$ga = new GoogleAuthenticator("/dev/null");
+
+echo "creating 10000 keys\n";
+$oldkey = "";
+for($i = 0; $i < 10000; $i++) {
+       $key = $ga->createBase32Key();
+       if($oldkey == $key) {
+               echo "Two identical keys created";
+       }
+       $old = $key;
+}
+
+echo "Last key: $key\n";
+?>
\ No newline at end of file