Skip to content

Commit 144de96

Browse files
committed
also init storage
1 parent 1ec3135 commit 144de96

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/testsuite/init-testsuite.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,35 @@ public static function createUser($testUser) {
2424
$queryParams[':data'] = json_encode($testUser);
2525
$query->execute($queryParams);
2626
}
27+
28+
public static function createStorage($testUser) {
29+
self::connect();
30+
$query = self::$pdo->prepare(
31+
'INSERT INTO storage VALUES (:storageId, :owner)'
32+
);
33+
34+
$queryParams = [];
35+
$queryParams[':storageId'] = $testUser['id'];
36+
$queryParams[':owner'] = "https://id-" . $testUser['id'] . "." . BASEDOMAIN . "/#me";
37+
$query->execute($queryParams);
38+
}
2739
}
2840

2941
TestUser::createUser([
3042
"id" => "alice",
3143
"password" => "alice123",
3244
"email" => "alice"
3345
]);
46+
TestUser::createStorage([
47+
"id" => "alice"
48+
]);
3449

3550
TestUser::createUser([
3651
"id" => "bob",
3752
"password" => "bob345",
3853
"email" => "bob"
3954
]);
55+
TestUser::createStorage([
56+
"id" => "bob"
57+
]);
4058

0 commit comments

Comments
 (0)