Skip to content

Commit

Permalink
Adapt expected HTML output within functional tests
Browse files Browse the repository at this point in the history
As TYPO3 changed actual generated HTML.
  • Loading branch information
DanielSiepmann committed Jun 26, 2024
1 parent 982dac7 commit 2b6682f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Documentation/Changelog/4.0.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Fixes

* Migrate deprecated PHPStan configuration options.

* Adapt expected HTML output within functional tests.
As TYPO3 changed actual generated HTML.

Tasks
-----

Expand Down
18 changes: 9 additions & 9 deletions Tests/Functional/Frontend/DatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ public function addsMetaTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta name="description" content="Teaser of Event" />', $html);
self::assertStringContainsString('<meta name="keywords" content="Gewölbe, Goethe, Horst Damm, Kästner, Theater" />', $html);
self::assertStringContainsString('<meta name="description" content="Teaser of Event">', $html);
self::assertStringContainsString('<meta name="keywords" content="Gewölbe, Goethe, Horst Damm, Kästner, Theater">', $html);
}

#[Test]
Expand All @@ -211,9 +211,9 @@ public function addsOpenGraphTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta property="og:title" content="Title of Event 15.02.2023 00:00" />', $html);
self::assertStringContainsString('<meta property="og:type" content="website" />', $html);
self::assertStringContainsString('<meta property="og:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif" />', $html);
self::assertStringContainsString('<meta property="og:title" content="Title of Event 15.02.2023 00:00">', $html);
self::assertStringContainsString('<meta property="og:type" content="website">', $html);
self::assertStringContainsString('<meta property="og:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif">', $html);
}

#[Test]
Expand All @@ -225,10 +225,10 @@ public function addsSocialMediaTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta name="twitter:card" content="summary" />', $html);
self::assertStringContainsString('<meta name="twitter:title" content="Title of Event 15.02.2023 00:00" />', $html);
self::assertStringContainsString('<meta name="twitter:description" content="Teaser of Event" />', $html);
self::assertStringContainsString('<meta name="twitter:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif" />', $html);
self::assertStringContainsString('<meta name="twitter:card" content="summary">', $html);
self::assertStringContainsString('<meta name="twitter:title" content="Title of Event 15.02.2023 00:00">', $html);
self::assertStringContainsString('<meta name="twitter:description" content="Teaser of Event">', $html);
self::assertStringContainsString('<meta name="twitter:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif">', $html);
}

#[Test]
Expand Down
18 changes: 9 additions & 9 deletions Tests/Functional/Frontend/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function addsMetaTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta name="description" content="Teaser of Event" />', $html);
self::assertStringContainsString('<meta name="keywords" content="Gewölbe, Goethe, Horst Damm, Kästner, Theater" />', $html);
self::assertStringContainsString('<meta name="description" content="Teaser of Event">', $html);
self::assertStringContainsString('<meta name="keywords" content="Gewölbe, Goethe, Horst Damm, Kästner, Theater">', $html);
}

#[Test]
Expand All @@ -67,9 +67,9 @@ public function addsOpenGraphTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta property="og:title" content="Title of Event" />', $html);
self::assertStringContainsString('<meta property="og:type" content="website" />', $html);
self::assertStringContainsString('<meta property="og:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif" />', $html);
self::assertStringContainsString('<meta property="og:title" content="Title of Event">', $html);
self::assertStringContainsString('<meta property="og:type" content="website">', $html);
self::assertStringContainsString('<meta property="og:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif">', $html);
}

#[Test]
Expand All @@ -81,10 +81,10 @@ public function addsSocialMediaTags(): void
self::assertSame(200, $response->getStatusCode());
$html = (string)$response->getBody();

self::assertStringContainsString('<meta name="twitter:card" content="summary" />', $html);
self::assertStringContainsString('<meta name="twitter:title" content="Title of Event" />', $html);
self::assertStringContainsString('<meta name="twitter:description" content="Teaser of Event" />', $html);
self::assertStringContainsString('<meta name="twitter:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif" />', $html);
self::assertStringContainsString('<meta name="twitter:card" content="summary">', $html);
self::assertStringContainsString('<meta name="twitter:title" content="Title of Event">', $html);
self::assertStringContainsString('<meta name="twitter:description" content="Teaser of Event">', $html);
self::assertStringContainsString('<meta name="twitter:image" content="http://example.com/fileadmin/user_uploads/example-for-event.gif">', $html);
}

#[Test]
Expand Down

0 comments on commit 2b6682f

Please sign in to comment.