24 lines
1.1 KiB
PHP
24 lines
1.1 KiB
PHP
<?php
|
|
function assertTrue($cond, $msg) {
|
|
if (!$cond) {
|
|
fwrite(STDERR, $msg . PHP_EOL);
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
$content = file_get_contents(__DIR__ . '/../pages/contact.php');
|
|
assertTrue(strpos($content, 'Retrouvez-moi aussi sur') !== false, 'missing section title');
|
|
assertTrue(strpos($content, 'linkedin.com/in/') !== false, 'missing linkedin link');
|
|
assertTrue(strpos($content, 'github.com/') !== false, 'missing github link');
|
|
assertTrue(strpos($content, 'id="email-link"') !== false, 'missing email link');
|
|
assertTrue(strpos($content, 'data-user=') !== false, 'missing data-user');
|
|
assertTrue(strpos($content, 'data-domain=') !== false, 'missing data-domain');
|
|
assertTrue(strpos($content, 'target="_blank"') !== false, 'missing target blank');
|
|
assertTrue(strpos($content, 'rel="noopener') !== false, 'missing rel noopener');
|
|
|
|
$js = file_get_contents(__DIR__ . '/../assets/js/main.js');
|
|
assertTrue(strpos($js, 'initEmailProtection') !== false, 'missing initEmailProtection');
|
|
assertTrue(strpos($js, 'mailto:') !== false, 'missing mailto reconstruction');
|
|
|
|
fwrite(STDOUT, "OK\n");
|