🐛 Fix: retour JSON contact

This commit is contained in:
2026-02-04 22:33:46 +01:00
parent f051f3738e
commit 9f89294952
11 changed files with 218 additions and 39 deletions

View File

@@ -10,6 +10,8 @@ $content = file_get_contents(__DIR__ . '/../assets/js/contact-form.js');
assertTrue(strpos($content, 'class ContactFormSubmit') !== false, 'missing ContactFormSubmit');
assertTrue(strpos($content, 'fetch(') !== false, 'missing fetch');
assertTrue(strpos($content, 'response.text') !== false, 'missing response.text');
assertTrue(strpos($content, 'JSON.parse') !== false, 'missing JSON.parse');
assertTrue(strpos($content, 'submit-text') !== false, 'missing submit-text');
assertTrue(strpos($content, 'submit-loading') !== false, 'missing submit-loading');
assertTrue(strpos($content, 'setLoadingState') !== false, 'missing loading state');

18
tests/phpmailer.test.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
function assertTrue($cond, $msg) {
if (!$cond) {
fwrite(STDERR, $msg . PHP_EOL);
exit(1);
}
}
$composer = file_get_contents(__DIR__ . '/../composer.json');
assertTrue(strpos($composer, 'phpmailer/phpmailer') !== false, 'missing phpmailer dependency');
$functions = file_get_contents(__DIR__ . '/../includes/functions.php');
assertTrue(strpos($functions, 'PHPMailer') !== false, 'missing PHPMailer usage');
$config = file_get_contents(__DIR__ . '/../includes/config.php');
assertTrue(strpos($config, 'MAIL_HOST') !== false, 'missing mail constants');
fwrite(STDOUT, "OK\n");

View File

@@ -27,4 +27,5 @@ php (Join-Path $here 'recaptcha.test.php')
php (Join-Path $here 'contact-api.test.php')
php (Join-Path $here 'contact-submit.test.php')
php (Join-Path $here 'contact-links.test.php')
php (Join-Path $here 'phpmailer.test.php')
'OK'