-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPageMock.php
More file actions
80 lines (64 loc) · 1.68 KB
/
PageMock.php
File metadata and controls
80 lines (64 loc) · 1.68 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
namespace ElaborateCode\JigsawLocalization\Mocks;
use Exception;
class PageMock
{
protected string $path = '';
public string $defaultLocale;
public array $localization = [];
public function setPath(string $path): static
{
$this->path = '/'.trim($path, '/');
return $this;
}
public function setLocalization(array $localization): static
{
$this->localization = $localization;
return $this;
}
/* =================================== */
// Mocked methods
/* =================================== */
/**
* returns the path to the current page, relative to the site root
*/
public function getPath(): string
{
return $this->path;
}
/**
* returns the relative path (i.e. parent directories) of the current page, relative to the site root
*/
public function getRelativePath()
{
throw new Exception('Method not mocked');
}
/**
* returns the full URL to the item, if baseUrl was defined in config.php
*/
public function getUrl()
{
throw new Exception('Method not mocked');
}
/**
* returns the filename of the page, without extension (e.g. my-first-page)
*/
public function getFilename()
{
throw new Exception('Method not mocked');
}
/**
* returns the file extension (e.g. md)
*/
public function getExtension()
{
throw new Exception('Method not mocked');
}
/**
* returns the last modified time of the file, as a Unix timestamp
*/
public function getModifiedTime()
{
throw new Exception('Method not mocked');
}
}