@@ 23-39 (lines=17) @@ | ||
20 | ||
21 | final class StaticSitemapServiceTest extends AbstractSitemapServiceTestCase |
|
22 | { |
|
23 | public function testSitemap(): void |
|
24 | { |
|
25 | $sitemap = new SitemapDefinition('demo', [ |
|
26 | 'priority' => 20, |
|
27 | 'url' => '/foo/bar', |
|
28 | 'changefreq' => Url::FREQUENCE_DAILY, |
|
29 | ]); |
|
30 | ||
31 | $optionResolver = new OptionsResolver(); |
|
32 | $this->service->configureSettings($optionResolver); |
|
33 | ||
34 | $sitemap->setSettings($optionResolver->resolve($sitemap->getSettings())); |
|
35 | ||
36 | $this->assertSitemap('/foo/bar', 20, Url::FREQUENCE_DAILY); |
|
37 | ||
38 | $this->process($sitemap); |
|
39 | } |
|
40 | ||
41 | public function testExecuteWIthNoUrl(): void |
|
42 | { |
|
@@ 41-57 (lines=17) @@ | ||
38 | $this->process($sitemap); |
|
39 | } |
|
40 | ||
41 | public function testExecuteWIthNoUrl(): void |
|
42 | { |
|
43 | $sitemap = new SitemapDefinition('demo', [ |
|
44 | 'priority' => 20, |
|
45 | 'url' => null, |
|
46 | 'changefreq' => Url::FREQUENCE_DAILY, |
|
47 | ]); |
|
48 | ||
49 | $optionResolver = new OptionsResolver(); |
|
50 | $this->service->configureSettings($optionResolver); |
|
51 | ||
52 | $sitemap->setSettings($optionResolver->resolve($sitemap->getSettings())); |
|
53 | ||
54 | $this->assertSitemapCount(0); |
|
55 | ||
56 | $this->process($sitemap); |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * {@inheritdoc} |