-
Notifications
You must be signed in to change notification settings - Fork 395
/
cleanup.php
59 lines (50 loc) · 1.54 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
53
54
55
56
57
58
59
<?php
include_once dirname(__FILE__) . '/config.php';
/**
* Not an actual test, just cleaning up
*/
class DeleteFlightsTest extends WebTestCase {
public 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 {
public 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 {
public 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 {
public 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";
}
}