unit tests and base code
[ga4php.git] / unittests / createurl.php
diff --git a/unittests/createurl.php b/unittests/createurl.php
new file mode 100644 (file)
index 0000000..7d3d4ca
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+require_once("../lib/lib.php");
+
+$ga = new GoogleAuthenticator("/dev/null");
+
+echo "creating 10000 keys\n";
+$oldkey = "";
+$key = $ga->createBase32Key();
+
+$url = $ga->createURL("someuser", $key);
+
+system("qrencode -s 6 -o /tmp/file.unittest $url");
+system("eog /tmp/file.unittest");
+unlink("/tmp/file.unittest");
+?>