Server : nginx/1.22.1
System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/www.jkmold.com/phpcms/libs/PHPMailer/test/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/phpcms/libs/PHPMailer/test/phpmailerLangTest.php
<?php

/**

 * PHPMailer - language file tests

 * Requires PHPUnit 3.3 or later.

 *

 * PHP version 5.0.0

 *

 * @package PHPMailer

 * @author Andy Prevost

 * @author Marcus Bointon <phpmailer@synchromedia.co.uk>

 * @copyright 2004 - 2009 Andy Prevost

 * @copyright 2010 Marcus Bointon

 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License

 */



require_once '../PHPMailerAutoload.php';



/**

 * PHPMailer - PHP email transport unit test class

 * Performs authentication tests

 */

class PHPMailerLangTest extends PHPUnit_Framework_TestCase

{

    /**

     * Holds a phpmailer instance.

     * @private

     * @var PHPMailer

     */

    public $Mail;



    /**

     * @var string Default include path

     */

    public $INCLUDE_DIR = '../';



    /**

     * Run before each test is started.

     */

    public function setUp()

    {

        $this->Mail = new PHPMailer;

    }



    /**

     * Test language files for missing and excess translations

     * All languages are compared with English

     * @group languages

     */

    public function testTranslations()

    {

        $this->Mail->setLanguage('en');

        $definedStrings = $this->Mail->getTranslations();

        $err = '';

        foreach (new DirectoryIterator('../language') as $fileInfo) {

            if ($fileInfo->isDot()) {

                continue;

            }

            $matches = array();

            //Only look at language files, ignore anything else in there

            if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) {

                $lang = $matches[1]; //Extract language code

                $PHPMAILER_LANG = array(); //Language strings get put in here

                include $fileInfo->getPathname(); //Get language strings

                $missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG));

                $extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings));

                if (!empty($missing)) {

                    $err .= "\nMissing translations in $lang: " . implode(', ', $missing);

                }

                if (!empty($extra)) {

                    $err .= "\nExtra translations in $lang: " . implode(', ', $extra);

                }

            }

        }

        $this->assertEmpty($err, $err);

    }

}