1 | <?php |
||
22 | abstract class AbstractSitemapServiceTestCase extends TestCase |
||
23 | { |
||
24 | protected $router; |
||
25 | |||
26 | /** |
||
27 | * @var SitemapServiceInterface |
||
28 | */ |
||
29 | protected $service; |
||
30 | |||
31 | /** |
||
32 | * @var array[] |
||
33 | */ |
||
34 | private $urls = []; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | protected function setUp(): void |
||
45 | |||
46 | /** |
||
47 | * @return SitemapServiceInterface |
||
48 | */ |
||
49 | abstract protected function createService(): SitemapServiceInterface; |
||
50 | |||
51 | /** |
||
52 | * @param SitemapDefinitionInterface $sitemap |
||
53 | */ |
||
54 | final protected function process(SitemapDefinitionInterface $sitemap): void |
||
84 | |||
85 | /** |
||
86 | * @param string $location |
||
87 | * @param int $priority |
||
88 | * @param string $changeFreq |
||
89 | * @param DateTime|null $lastMod |
||
90 | */ |
||
91 | final protected function assertSitemap(string $location, int $priority, string $changeFreq, DateTime $lastMod = null): void |
||
95 | |||
96 | /** |
||
97 | * @param UrlInterface $url |
||
98 | * |
||
99 | * @return array|null |
||
100 | */ |
||
101 | private function &containsUrl(UrlInterface $url): ?array |
||
111 | |||
112 | /** |
||
113 | * @param array|null $data |
||
114 | * @param UrlInterface $url |
||
115 | */ |
||
116 | private function assertLastmod(?array $data, UrlInterface $url): void |
||
132 | |||
133 | /** |
||
134 | * @param UrlInterface $url |
||
135 | * @param array|null $data |
||
136 | */ |
||
137 | private function assertPriority(UrlInterface $url, ?array $data): void |
||
150 | |||
151 | /** |
||
152 | * @param UrlInterface $url |
||
153 | * @param array|null $data |
||
154 | */ |
||
155 | private function assertChangeFreq(UrlInterface $url, ?array $data): void |
||
168 | } |
||
169 |