Skip to content

Commit 20b9d5d

Browse files
committed
Add test for relative links
1 parent 6c38740 commit 20b9d5d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/Test.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,21 @@
7272

7373
$File = __DIR__ . '/../descriptions/' . $TestType . '.md';
7474

75-
if( !str_starts_with( $TestType, 'Evidence.' ) && !file_exists( $File ) )
75+
if( !file_exists( $File ) )
7676
{
77-
$FailingTests[] = "\"descriptions/{$TestType}.md\" does not exist";
77+
if( !str_starts_with( $TestType, 'Evidence.' ) )
78+
{
79+
$FailingTests[] = "\"descriptions/{$TestType}.md\" does not exist";
80+
}
81+
82+
continue;
83+
}
84+
85+
$Text = file_get_contents( $File );
86+
87+
if( str_contains( $Text, 'steamdb.info' ) )
88+
{
89+
$FailingTests[] = "\"descriptions/{$TestType}.md\" - SteamDB links in descriptions should be relative (do not include the domain)";
7890
}
7991
}
8092

0 commit comments

Comments
 (0)