| Server IP : 88.99.149.37 / Your IP : 216.73.216.141 Web Server : nginx/1.31.2 System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64 User : muralimurth ( 1015) PHP Version : 8.4.23 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/cwd/wp-content/plugins/smtp2go/tests/ |
Upload File : |
<?php
/**
* These functions are used in place of real wordpress functions in Unit Tests
* They provide the bare minimum of functionality for the tests to run
*/
use SMTP2GO\Senders\CurlSender;
use SMTP2GO\SMTP2GOMailer;
define('ABSPATH', dirname(__FILE__, 5) . '/');
define('WPINC', 'wp-includes');
function wp_remote_post($url, $payload)
{
$sender = new $GLOBALS['senderClassName'];
$result = $sender->send($url, array('body' => json_decode($payload['body'], true)));
//Array containing 'headers', 'body', 'response', 'cookies', 'filename'
return array(
'body' => json_encode($sender->getLastResponse()),
'headers' => [],
);
}
function get_option($option, $default = '')
{
switch (true) {
case $option == 'smtp2go_from_address':
return SMTP2GO_TEST_SENDER_EMAIL;
break;
case $option == 'smtp2go_from_name':
return SMTP2GO_TEST_SENDER_NAME;
break;
case $option == 'smtp2go_api_key':
return SMTP2GO_API_KEY;
break;
case $option == 'smtp2go_custom_headers':
return array(['x-sent-by' => 'phpunit test']);
break;
}
}
function apply_filters($tag, $args)
{
if ($tag === 'wp_mail') {
global $phpmailer;
if (!$phpmailer instanceof SMTP2GOMailer) {
$phpmailer = new SMTP2GOMailer;
$phpmailer->wp_args = $args;
} else {
$phpmailer->wp_args = $args;
}
}
}
function network_home_url($path = '', $scheme = null)
{
return 'http://test.test';
}
function is_wp_error($thing)
{
return false;
}
function get_bloginfo($option)
{
switch (true) {
case $option == 'charset':
return 'UTF-8';
break;
}
}
function do_action_ref_array($tag, $args)
{
return;
}
function do_action($tag, ...$arg)
{
return;
}
function wp_parse_url($url, $component = -1)
{
return parse_url($url, $component);
}