| @@ 23-37 (lines=15) @@ | ||
| 20 | // Tester |
|
| 21 | /////////// |
|
| 22 | ||
| 23 | function testTotalPokemon() { |
|
| 24 | $req = "SELECT COUNT(*) as total FROM sightings"; |
|
| 25 | $result = pg_query($this->db, $req); |
|
| 26 | if ($result === false) { |
|
| 27 | return 1; |
|
| 28 | } else { |
|
| 29 | $data = pg_fetch_object($result); |
|
| 30 | $total = $data->total; |
|
| 31 | ||
| 32 | if ($total == 0) { |
|
| 33 | return 2; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | return 0; |
|
| 37 | } |
|
| 38 | ||
| 39 | function testTotalGyms() { |
|
| 40 | $req = "SELECT COUNT(*) as total FROM forts"; |
|
| @@ 39-53 (lines=15) @@ | ||
| 36 | return 0; |
|
| 37 | } |
|
| 38 | ||
| 39 | function testTotalGyms() { |
|
| 40 | $req = "SELECT COUNT(*) as total FROM forts"; |
|
| 41 | $result = pg_query($this->db, $req); |
|
| 42 | if ($result === false) { |
|
| 43 | return 1; |
|
| 44 | } else { |
|
| 45 | $data = pg_fetch_object($result); |
|
| 46 | $total = $data->total; |
|
| 47 | ||
| 48 | if ($total == 0) { |
|
| 49 | return 2; |
|
| 50 | } |
|
| 51 | } |
|
| 52 | return 0; |
|
| 53 | } |
|
| 54 | ||
| 55 | function testTotalPokestops() { |
|
| 56 | $req = "SELECT COUNT(*) as total FROM pokestops"; |
|
| @@ 55-69 (lines=15) @@ | ||
| 52 | return 0; |
|
| 53 | } |
|
| 54 | ||
| 55 | function testTotalPokestops() { |
|
| 56 | $req = "SELECT COUNT(*) as total FROM pokestops"; |
|
| 57 | $result = pg_query($this->db, $req); |
|
| 58 | if ($result === false) { |
|
| 59 | return 1; |
|
| 60 | } else { |
|
| 61 | $data = pg_fetch_object($result); |
|
| 62 | $total = $data->total; |
|
| 63 | ||
| 64 | if ($total == 0) { |
|
| 65 | return 2; |
|
| 66 | } |
|
| 67 | } |
|
| 68 | return 0; |
|
| 69 | } |
|
| 70 | ||
| 71 | ||
| 72 | ///////////// |
|