%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/var/www/html/ppaobm/vendor/codeception/base/tests/unit/ |
Upload File : |
<?php
use Codeception\Configuration;
class C3Test extends \PHPUnit\Framework\TestCase
{
/**
* @var string
*/
public $c3 = null;
/**
* @var string
*/
public $c3_dir = null;
protected function setUp()
{
if (!extension_loaded('xdebug')) {
$this->markTestSkipped('xdebug extension required for c3test.');
}
$this->c3 = Configuration::dataDir() . 'claypit/c3.php';
$this->c3_dir = Codeception\Configuration::outputDir() . 'c3tmp/';
@mkdir($this->c3_dir, 0777, true);
$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE'] = 'test';
$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG'] = 'debug';
}
protected function tearDown()
{
unset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG']);
unset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
\Codeception\Util\FileSystem::deleteDir($this->c3_dir);
}
public function testC3CodeCoverageStarted()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('This test fails on HHVM');
}
$_SERVER['REQUEST_URI'] = '/';
include $this->c3;
$this->assertInstanceOf('PHP_CodeCoverage', $codeCoverage);
}
public function testCodeCoverageRestrictedAccess()
{
unset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
include $this->c3;
$this->assertFalse(isset($config_file));
$this->assertFalse(isset($requested_c3_report));
}
public function testCodeCoverageCleanup()
{
$_SERVER['REQUEST_URI'] = '/c3/report/clear';
$cc_file = $this->c3_dir . 'dummy.txt';
file_put_contents($cc_file, 'nothing');
include $this->c3;
$this->assertEquals('clear', $route);
$this->assertFileNotExists($cc_file);
}
public function testCodeCoverageHtmlReport()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Remote coverage HTML report does not work on HHVM');
}
$_SERVER['REQUEST_URI'] = '/c3/report/html';
include $this->c3;
$this->assertEquals('html', $route);
$this->assertFileExists($this->c3_dir . 'codecoverage.tar');
}
public function testCodeCoverageXmlReport()
{
$_SERVER['REQUEST_URI'] = '/c3/report/clover';
include $this->c3;
$this->assertEquals('clover', $route);
$this->assertFileExists($this->c3_dir . 'codecoverage.clover.xml');
}
public function testCodeCoverageSerializedReport()
{
$_SERVER['REQUEST_URI'] = '/c3/report/serialized';
include $this->c3;
$this->assertEquals('serialized', $route);
$this->assertInstanceOf('PHP_CodeCoverage', $codeCoverage);
}
}