Decoded Output
Download<?php
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Phalcon\Tests\Unit\Http\Request;
use Phalcon\Tests\Unit\Http\Helper\HttpBase;
use UnitTester;
class GetPortCest extends HttpBase
{
/**
* Tests Request::getPort
*
* @author Phalcon Team <[email protected]>
* @since 2016-06-26
*/
public function testHttpRequestPort(UnitTester $I)
{
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'on');
$this->setServerVar('HTTP_HOST', 'example.com');
$I->assertSame(
443,
$request->getPort()
);
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'off');
$this->setServerVar('HTTP_HOST', 'example.com');
$I->assertSame(
80,
$request->getPort()
);
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'off');
$this->setServerVar('HTTP_HOST', 'example.com:8080');
$I->assertSame(
8080,
$request->getPort()
);
$this->setServerVar('HTTPS', 'on');
$this->setServerVar('HTTP_HOST', 'example.com:8081');
$I->assertSame(
8081,
$request->getPort()
);
unset(
$_SERVER['HTTPS']
);
$this->setServerVar('HTTP_HOST', 'example.com:8082');
$I->assertSame(
8082,
$request->getPort()
);
}
}
?>
Did this file decode correctly?
How would you describe this file?
Thank you for your feedback! This will help us detect malicious PHP files more accurately in the future.
Function Calls
None
Variables
None
Stats
| MD5 | bb25743a853574a1 |
|---|---|
| Eval Count | 0 |
| Decode Time | 124 ms |
Original Code
<?php
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Phalcon\Tests\Unit\Http\Request;
use Phalcon\Tests\Unit\Http\Helper\HttpBase;
use UnitTester;
class GetPortCest extends HttpBase
{
/**
* Tests Request::getPort
*
* @author Phalcon Team <[email protected]>
* @since 2016-06-26
*/
public function testHttpRequestPort(UnitTester $I)
{
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'on');
$this->setServerVar('HTTP_HOST', 'example.com');
$I->assertSame(
443,
$request->getPort()
);
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'off');
$this->setServerVar('HTTP_HOST', 'example.com');
$I->assertSame(
80,
$request->getPort()
);
$request = $this->getRequestObject();
$this->setServerVar('HTTPS', 'off');
$this->setServerVar('HTTP_HOST', 'example.com:8080');
$I->assertSame(
8080,
$request->getPort()
);
$this->setServerVar('HTTPS', 'on');
$this->setServerVar('HTTP_HOST', 'example.com:8081');
$I->assertSame(
8081,
$request->getPort()
);
unset(
$_SERVER['HTTPS']
);
$this->setServerVar('HTTP_HOST', 'example.com:8082');
$I->assertSame(
8082,
$request->getPort()
);
}
}