removed eronius comment
[ga4php.git] / unittests / authtest.php
1 <?php
2
3 require_once("../lib/ga4php.php");
4
5 // just in case
6
7 unlink("/tmp/db.sqlite");
8 $ga = new GoogleAuthenticator("/tmp/db.sqlite");
9
10 // first lets try hotp, should be 393101, 805347 then 428248
11 $ga->createUser("User1", "9732e257c94c9930818d");
12
13 if($ga->authenticateUser("User1", "393101")) {
14         echo "Passed: correct\n";
15 } else {
16         echo "Failed: INCORRECT\n";
17 }
18
19 if($ga->authenticateUser("User1", "805347")) {
20         echo "Passed: correct\n";
21 } else {
22         echo "Failed: INCORRECT\n";
23 }
24
25 if($ga->authenticateUser("User1", "428248")) {
26         echo "Passed: correct\n";
27 } else {
28         echo "Failed: INCORRECT\n";
29 }
30
31 if($ga->authenticateUser("User1", "234523")) {
32         echo "Passed: INCORRECT\n";
33 } else {
34         echo "Failed: correct\n";
35 }
36
37 if($ga->authenticateUser("User1", "598723")) {
38         echo "Passed: correct\n";
39 } else {
40         echo "Failed: INCORRECT\n";
41 }
42
43 ?>