changes to how testactions work

This commit is contained in:
2019-09-19 12:08:16 +02:00
parent 7c009bcd96
commit 6121e31459
9 changed files with 303 additions and 231 deletions

View File

@@ -4,7 +4,7 @@ if(isset($_POST['auth'])){
populateDB();
}
}else{
echol('you have no authorization to do that');
self::logMessage('you have no authorization to do that', "OK");
}
function populateDB(){
@@ -32,16 +32,16 @@ function populateDB(){
echol('table doesnt exist');
self::logMessage('table doesnt exist', "OK");
$query = $con->query("INSERT INTO users (username, email, password, login_date, reg_ip, active) VALUES ( 'andreas', 'andreas@andreas.nl', 'jenk', '2019-01-01 14:35:33', '192.168.0.2', 1),
( 'bram', 'bram@bram.nl', 'jenk', '2019-01-01 14:35:33', '192.168.0.1', 1)");
echol("created test users");
self::logMessage("created test users", "OK");
$query = $con->query("INSERT INTO `board` (`name`, `description`, `permLevel`) VALUES ('General Discussion', 'Plek om algemene discussie te voeren.', '0'),
('Off Topic', 'Voor alle irrelevante zooi.', '0')");
echol("created test boards");
self::logMessage("created test boards", "OK");
$query = $con->query("INSERT INTO `thread` (`users_ID`, `board_ID`, `title`, `text`, `date_created`) VALUES ('1', '1', 'Test thread', 'Deze thread is een test.', '2019-06-20 13:55:37'),
('1', '2', 'Waa', 'Frist niffo', '2019-06-20 13:56:42')");
echol("created test threads");
self::logMessage("created test threads", "OK");
$query = $con->query("INSERT INTO `reply` (`thread_ID`, `users_ID`, `content`, `date_created`) VALUES ('1', '1', 'heehee eks dee', '2019-06-21 11:01:57'),
('1', '1', 'hoi\r\n', '2019-06-21 11:07:25'),
('2', '2', 'fristi niBBa', '2019-06-21 11:08:08'),
@@ -49,9 +49,10 @@ function populateDB(){
('1', '2', 'Mijn naam is bram', '2019-06-21 17:58:12'),
('1', '2', 'huh wuddufuq', '2019-06-21 17:58:29'),
('1', '1', 'huts a neef', '2019-06-21 17:59:27')");
echol("created test replies");
self::logMessage("created test replies", "OK");
}
catch(PDOException $e){
self::logMessage("created test replies", "FAILURE");
die("pdo exception, cannot connect to sql:<br> $e");
}
}