-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.php
More file actions
80 lines (68 loc) · 1.83 KB
/
Copy pathDatabase.php
File metadata and controls
80 lines (68 loc) · 1.83 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
class Database {
function connect() {
return new MysqliMock();
}
}
class MysqliMock {
public $connect_error = '';
function prepare($sql): MysqliStmtMock {
return new MysqliStmtMock;
}
function close(): bool {
return true;
}
}
class MysqliStmtMock {
function bind_param() {
return true;
}
function execute() {
return true;
}
function get_result(): MysqliResultMock {
return new MysqliResultMock;
}
}
class MysqliResultMock {
private $numRowsSent = 0;
public $num_rows = 1;
function fetch_object() {
if ($this->numRowsSent > 0) {
return false;
}
$this->numRowsSent++;
return (object)[
'nombre_completo'=>'HAKTAN TUNGER',
'folio'=>'99',
'edad'=>'54',
'sexo'=>'MASCULINO / MALE',
'nacionalidad'=>'TURKEY',
'correo'=>'haktant4@hotmail.com',
'antigeno'=>'NEGATIVE',
'fecha_hora'=>'January 30, 2021, 7:31 pm', // F j, Y, g:i a
'metodo'=>'Inmunocromatografía / Immunochromatography',
'oxigenacion'=>'95',
'temperatura'=>'36.4'
];
}
function fetch_assoc() {
if ($this->numRowsSent > 0) {
return false;
}
$this->numRowsSent++;
return [
'nombre_completo'=>'HAKTAN TUNGER',
'folio'=>'99',
'edad'=>'54',
'sexo'=>'MASCULINO / MALE',
'nacionalidad'=>'TURKEY',
'correo'=>'haktant4@hotmail.com',
'antigeno'=>'NEGATIVE',
'fecha_hora'=>'January 30, 2021, 7:31 pm', // F j, Y, g:i a
'metodo'=>'Inmunocromatografía / Immunochromatography',
'oxigenacion'=>'95',
'temperatura'=>'36.4'
];
}
}