-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-config.php
More file actions
64 lines (59 loc) · 1.66 KB
/
Copy pathtest-config.php
File metadata and controls
64 lines (59 loc) · 1.66 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
<?php
namespace Pdsinterop\PhpSolid;
const DBPATH = ":memory:";
const TRUSTED_IPS = ['127.0.0.100'];
const BANNED_PASSWORDS = [];
const MINIMUM_PASSWORD_ENTROPY = 10;
const BASEDOMAIN = "solid.example.com";
const BASEURL = "https://solid.example.com";
const PUBSUB_SERVER = "https://localhost:1234";
const KEYDIR = "php://memory/";
const STORAGEBASE = ".";
function header($header) {
if (class_exists('Pdsinterop\PhpSolid\MiddleWareTest')) {
MiddleWareTest::$headers[] = $header;
}
if (class_exists('Pdsinterop\PhpSolid\ServerTest')) {
ServerTest::$headers[] = $header;
}
if (class_exists('Pdsinterop\PhpSolid\StorageServerTest')) {
StorageServerTest::$headers[] = $header;
}
}
function file_get_contents($file) {
if (class_exists('Pdsinterop\PhpSolid\ServerTest')) {
if(!isset(ServerTest::$keys)) {
ServerTest::$keys = Server::generateKeySet();
}
if (preg_match("/encryption/", $file)) {
return ServerTest::$keys['encryptionKey'];
}
if (preg_match("/public/", $file)) {
return ServerTest::$keys['publicKey'];
}
if (preg_match("/private/", $file)) {
return ServerTest::$keys['privateKey'];
}
}
}
class MockBody {
public function rewind() {
return true;
}
public function getContents() {
return json_encode(["Hello" => "world"]);
}
}
class MockResponse {
public function getStatusCode() {
return 200;
}
public function getBody() {
return new MockBody();
}
public function getHeaders() {
return [
"Foo" => ["Bar", "Blah"]
];
}
}