Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
6 / 6 |
FakeCDN | |
100.00% |
1 / 1 |
|
100.00% |
6 / 6 |
7 | |
100.00% |
6 / 6 |
getZoneByAliasName | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
purgeFilesByUrls | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
createZone | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
zone | |
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
|||
deleteAlias | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
createAlias | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
1 | <?php |
2 | namespace Qmp\Laravel\CDNApi\Cdn; |
3 | |
4 | use Qmp\Laravel\CDNApi\Cdn\AbstractProvider; |
5 | |
6 | class FakeCDN extends AbstractProvider |
7 | { |
8 | private $zoneExample = [ |
9 | "id" => "152428", |
10 | "name" => "0", |
11 | "status" => "active", |
12 | "type" => "pull", |
13 | "forcedownload" => "disabled", |
14 | "cors" => "enabled", |
15 | "gzip" => "enabled", |
16 | "expire" => "10080", |
17 | "blockbadbots" => "disabled", |
18 | "allowemptyreferrer" => "enabled", |
19 | "http2" => "enabled", |
20 | "securetoken" => "disabled", |
21 | "sslcert" => "letsencrypt", |
22 | "customsslkey" => "", |
23 | "customsslcert" => "", |
24 | "forcessl" => "disabled", |
25 | "originurl" => "https://fake-cdn-mirror-digital.advertise-me.net", |
26 | "originshield" => "disabled", |
27 | "cachemaxexpire" => "1440", |
28 | "cacheignorecachecontrol" => "enabled", |
29 | "cacheignorequerystring" => "enabled", |
30 | "cachehostheader" => "disabled", |
31 | "cachekeyscheme" => "disabled", |
32 | "cachekeyhost" => "disabled", |
33 | "cachekeycookie" => "", |
34 | "cachekeydevice" => "disabled", |
35 | "cachebr" => "disabled", |
36 | "cachecookies" => "enabled", |
37 | "cachestripcookies" => "enabled", |
38 | "cachexpullkey" => "KeyCDN", |
39 | "cachecanonical" => "enabled", |
40 | "cacherobots" => "disabled", |
41 | "cacheerrorpages" => "enabled", |
42 | "aliases" => [ |
43 | [ |
44 | "id" => "92891", |
45 | "zone_id" => "152428", |
46 | "name" => "cdn.momentdeal.fr", |
47 | ] |
48 | ], |
49 | "referrers" => [], |
50 | ]; |
51 | |
52 | private $aliasExample = [ |
53 | "id" => "92891", |
54 | "zone_id" => "152428", |
55 | "name" => "cdn.momentdeal.fr", |
56 | ]; |
57 | |
58 | public function getZoneByAliasName($aliasName, $aliases = true, $referrers = true) |
59 | { |
60 | return $this->zoneExample; |
61 | } |
62 | |
63 | public function purgeFilesByUrls($zoneId, array $urls = []) |
64 | { |
65 | return true; |
66 | } |
67 | |
68 | public function createZone(array $data = []) |
69 | { |
70 | return $this->zoneExample; |
71 | } |
72 | |
73 | public function zone($id = null, $aliases = true, $referrers = true) |
74 | { |
75 | return $id !== null ? $this->zoneExample : [$this->zoneExample]; |
76 | } |
77 | |
78 | public function deleteAlias($zoneId) |
79 | { |
80 | return true; |
81 | } |
82 | |
83 | public function createAlias($zoneId, $url) |
84 | { |
85 | return $this->aliasExample; |
86 | } |
87 | } |