🐛 Fix: retour JSON contact
This commit is contained in:
@@ -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
18
tests/phpmailer.test.php
Normal 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");
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user