for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of tenside/core.
*
* (c) Christian Schiffler <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* This project is provided in good faith and hope to be usable by anyone.
* @package tenside/core
* @author Christian Schiffler <[email protected]>
* @copyright 2015 Christian Schiffler <[email protected]>
* @license https://github.com/tenside/core/blob/master/LICENSE MIT
* @link https://github.com/tenside/core
* @filesource
*/
namespace Tenside\Core\SelfTest\Generic;
use Symfony\Component\HttpFoundation\Request;
use Tenside\Core\SelfTest\AbstractSelfTest;
* This class tests that we are in secure environment.
class SelfTestCalledViaHttps extends AbstractSelfTest
{
* Check that we are being called via HTTPS in favor of HTTP.
* @return void
protected function doTest()
$this->setMessage('Check that HTTPS is used instead of HTTP.');
$request = Request::createFromGlobals();
if ($request->isSecure()) {
$this->markSuccess();
return;
}
$this->markWarning('HTTPS is not used.');