An initially working library.
[ga4php.git] / unittests / createuser.php
diff --git a/unittests/createuser.php b/unittests/createuser.php
new file mode 100644 (file)
index 0000000..7b037a4
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+require_once("../lib/lib.php");
+
+$dbfile = "/tmp/db.sqlite";
+
+$ga = new GoogleAuthenticator($dbfile);
+
+$oldkey = "";
+$key = $ga->createBase32Key();
+
+$url = $ga->setupUser("someuser", $key);
+
+system("qrencode -s 6 -o /tmp/file.unittest $url");
+system("eog /tmp/file.unittest");
+unlink("/tmp/file.unittest");
+
+?>
\ No newline at end of file