Files
Portfolio-Codex/tests/phpmailer.test.php
2026-02-04 22:52:45 +01:00

21 lines
764 B
PHP

<?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');
assertTrue(strpos($functions, 'MAIL_HOST') !== false, 'missing MAIL_HOST usage');
assertTrue(strpos($functions, 'isSMTP') !== false, 'missing SMTP usage');
$config = file_get_contents(__DIR__ . '/../includes/config.php');
assertTrue(strpos($config, 'MAIL_HOST') !== false, 'missing mail constants');
fwrite(STDOUT, "OK\n");