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