|
@@ 49-67 (lines=19) @@
|
| 46 |
|
$this->process($sitemap->reveal()); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testAssertUrlNotCalled(): void |
| 50 |
|
{ |
| 51 |
|
$this->expectException(AssertionFailedError::class); |
| 52 |
|
$this->expectExceptionMessage("The url '/path/foo' was not expected to be called."); |
| 53 |
|
|
| 54 |
|
$sitemap = $this->prophesize(SitemapDefinitionInterface::class); |
| 55 |
|
|
| 56 |
|
$this->serviceMock->execute($sitemap) |
| 57 |
|
->willReturn( |
| 58 |
|
[ |
| 59 |
|
new Url('/path/foo', 20, Url::FREQUENCE_DAILY), |
| 60 |
|
] |
| 61 |
|
) |
| 62 |
|
; |
| 63 |
|
|
| 64 |
|
$this->assertSitemap('/path/bar', 20, Url::FREQUENCE_DAILY); |
| 65 |
|
|
| 66 |
|
$this->process($sitemap->reveal()); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
public function testAssertLastmod(): void |
| 70 |
|
{ |
|
@@ 87-103 (lines=17) @@
|
| 84 |
|
$this->process($sitemap->reveal()); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
public function testAssertPriority(): void |
| 88 |
|
{ |
| 89 |
|
$this->expectException(AssertionFailedError::class); |
| 90 |
|
$this->expectExceptionMessage("The url '/path/foo' was expected with 20 priority. 60 given."); |
| 91 |
|
|
| 92 |
|
$sitemap = $this->prophesize(SitemapDefinitionInterface::class); |
| 93 |
|
|
| 94 |
|
$this->serviceMock->execute($sitemap) |
| 95 |
|
->willReturn([ |
| 96 |
|
new Url('/path/foo', 60, Url::FREQUENCE_DAILY), |
| 97 |
|
]) |
| 98 |
|
; |
| 99 |
|
|
| 100 |
|
$this->assertSitemap('/path/foo', 20, Url::FREQUENCE_DAILY); |
| 101 |
|
|
| 102 |
|
$this->process($sitemap->reveal()); |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
public function testAssertChangeFreq(): void |
| 106 |
|
{ |
|
@@ 105-121 (lines=17) @@
|
| 102 |
|
$this->process($sitemap->reveal()); |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
public function testAssertChangeFreq(): void |
| 106 |
|
{ |
| 107 |
|
$this->expectException(AssertionFailedError::class); |
| 108 |
|
$this->expectExceptionMessage("The url '/path/foo' was expected with weekly changefreq. daily given."); |
| 109 |
|
|
| 110 |
|
$sitemap = $this->prophesize(SitemapDefinitionInterface::class); |
| 111 |
|
|
| 112 |
|
$this->serviceMock->execute($sitemap) |
| 113 |
|
->willReturn([ |
| 114 |
|
new Url('/path/foo', 20, Url::FREQUENCE_DAILY), |
| 115 |
|
]) |
| 116 |
|
; |
| 117 |
|
|
| 118 |
|
$this->assertSitemap('/path/foo', 20, Url::FREQUENCE_WEEKLY); |
| 119 |
|
|
| 120 |
|
$this->process($sitemap->reveal()); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
protected function createService(): SitemapServiceInterface |
| 124 |
|
{ |