forked from jpatokal/openflights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.php
52 lines (43 loc) · 1.39 KB
/
cleanup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include_once(dirname(__FILE__) . '/config.php');
// Not an actual test, just cleaning up
class DeleteFlightsTest extends WebTestCase {
function test() {
global $settings;
$dbh = db_connect();
$sth = $dbh->prepare("DELETE FROM flights WHERE uid IN (SELECT uid FROM users WHERE name=?)");
$sth->execute([$settings["name"]]);
echo $sth->rowCount() . " flights deleted\n";
}
}
// Not an actual test, just cleaning up
class DeleteAirportTest extends WebTestCase {
function test() {
global $settings;
$dbh = db_connect();
$sth = $dbh->prepare("DELETE FROM airports WHERE uid IN (SELECT uid FROM users WHERE name=?)");
$sth->execute([$settings["name"]]);
echo $sth->rowCount() . " airports deleted\n";
}
}
// Not an actual test, just cleaning up
class DeleteAirlinesTest extends WebTestCase {
function test() {
global $settings;
$dbh = db_connect();
$sth = $dbh->prepare("DELETE FROM airlines WHERE uid IN (SELECT uid FROM users WHERE name=?)");
$sth->execute([$settings["name"]]);
echo $sth->rowCount() . " airline(s) deleted\n";
}
}
// Not an actual test, just cleaning up
class DeleteUserTest extends WebTestCase {
function test() {
global $settings;
$dbh = db_connect();
$sth = $dbh->prepare("DELETE FROM users WHERE name=?");
$sth->execute([$settings["name"]]);
echo $sth->rowCount() . " user deleted\n";
}
}
?>