first commit
This commit is contained in:
343
vendor/phpunit/php-code-coverage/tests/TestCase.php
vendored
Normal file
343
vendor/phpunit/php-code-coverage/tests/TestCase.php
vendored
Normal file
@ -0,0 +1,343 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\Driver\Xdebug;
|
||||
|
||||
/**
|
||||
* Abstract base class for test case classes.
|
||||
*
|
||||
* @since Class available since Release 1.0.0
|
||||
*/
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $TEST_TMP_PATH;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$TEST_TMP_PATH = TEST_FILES_PATH . 'tmp';
|
||||
}
|
||||
|
||||
protected function getXdebugDataForBankAccount()
|
||||
{
|
||||
return [
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
8 => 1,
|
||||
9 => -2,
|
||||
13 => -1,
|
||||
14 => -1,
|
||||
15 => -1,
|
||||
16 => -1,
|
||||
18 => -1,
|
||||
22 => -1,
|
||||
24 => -1,
|
||||
25 => -2,
|
||||
29 => -1,
|
||||
31 => -1,
|
||||
32 => -2
|
||||
]
|
||||
],
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
8 => 1,
|
||||
13 => 1,
|
||||
16 => 1,
|
||||
29 => 1,
|
||||
]
|
||||
],
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
8 => 1,
|
||||
13 => 1,
|
||||
16 => 1,
|
||||
22 => 1,
|
||||
]
|
||||
],
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
8 => 1,
|
||||
13 => 1,
|
||||
14 => 1,
|
||||
15 => 1,
|
||||
18 => 1,
|
||||
22 => 1,
|
||||
24 => 1,
|
||||
29 => 1,
|
||||
31 => 1,
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
protected function getCoverageForBankAccount()
|
||||
{
|
||||
$data = $this->getXdebugDataForBankAccount();
|
||||
require_once TEST_FILES_PATH . '/BankAccountTest.php';
|
||||
|
||||
$stub = $this->createMock(Xdebug::class);
|
||||
|
||||
$stub->expects($this->any())
|
||||
->method('stop')
|
||||
->will($this->onConsecutiveCalls(
|
||||
$data[0],
|
||||
$data[1],
|
||||
$data[2],
|
||||
$data[3]
|
||||
));
|
||||
|
||||
$filter = new Filter;
|
||||
$filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
|
||||
|
||||
$coverage = new CodeCoverage($stub, $filter);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceIsInitiallyZero'),
|
||||
true
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)]
|
||||
);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceCannotBecomeNegative')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)]
|
||||
);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceCannotBecomeNegative2')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)]
|
||||
);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testDepositWithdrawMoney')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => array_merge(
|
||||
range(6, 9),
|
||||
range(20, 25),
|
||||
range(27, 32)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
return $coverage;
|
||||
}
|
||||
|
||||
protected function getCoverageForBankAccountForFirstTwoTests()
|
||||
{
|
||||
$data = $this->getXdebugDataForBankAccount();
|
||||
|
||||
$stub = $this->createMock(Xdebug::class);
|
||||
|
||||
$stub->expects($this->any())
|
||||
->method('stop')
|
||||
->will($this->onConsecutiveCalls(
|
||||
$data[0],
|
||||
$data[1]
|
||||
));
|
||||
|
||||
$filter = new Filter;
|
||||
$filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
|
||||
|
||||
$coverage = new CodeCoverage($stub, $filter);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceIsInitiallyZero'),
|
||||
true
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(6, 9)]
|
||||
);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceCannotBecomeNegative')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(27, 32)]
|
||||
);
|
||||
|
||||
return $coverage;
|
||||
}
|
||||
|
||||
protected function getCoverageForBankAccountForLastTwoTests()
|
||||
{
|
||||
$data = $this->getXdebugDataForBankAccount();
|
||||
|
||||
$stub = $this->createMock(Xdebug::class);
|
||||
|
||||
$stub->expects($this->any())
|
||||
->method('stop')
|
||||
->will($this->onConsecutiveCalls(
|
||||
$data[2],
|
||||
$data[3]
|
||||
));
|
||||
|
||||
$filter = new Filter;
|
||||
$filter->addFileToWhitelist(TEST_FILES_PATH . 'BankAccount.php');
|
||||
|
||||
$coverage = new CodeCoverage($stub, $filter);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testBalanceCannotBecomeNegative2')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[TEST_FILES_PATH . 'BankAccount.php' => range(20, 25)]
|
||||
);
|
||||
|
||||
$coverage->start(
|
||||
new \BankAccountTest('testDepositWithdrawMoney')
|
||||
);
|
||||
|
||||
$coverage->stop(
|
||||
true,
|
||||
[
|
||||
TEST_FILES_PATH . 'BankAccount.php' => array_merge(
|
||||
range(6, 9),
|
||||
range(20, 25),
|
||||
range(27, 32)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
return $coverage;
|
||||
}
|
||||
|
||||
protected function getExpectedDataArrayForBankAccount()
|
||||
{
|
||||
return [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
8 => [
|
||||
0 => 'BankAccountTest::testBalanceIsInitiallyZero',
|
||||
1 => 'BankAccountTest::testDepositWithdrawMoney'
|
||||
],
|
||||
9 => null,
|
||||
13 => [],
|
||||
14 => [],
|
||||
15 => [],
|
||||
16 => [],
|
||||
18 => [],
|
||||
22 => [
|
||||
0 => 'BankAccountTest::testBalanceCannotBecomeNegative2',
|
||||
1 => 'BankAccountTest::testDepositWithdrawMoney'
|
||||
],
|
||||
24 => [
|
||||
0 => 'BankAccountTest::testDepositWithdrawMoney',
|
||||
],
|
||||
25 => null,
|
||||
29 => [
|
||||
0 => 'BankAccountTest::testBalanceCannotBecomeNegative',
|
||||
1 => 'BankAccountTest::testDepositWithdrawMoney'
|
||||
],
|
||||
31 => [
|
||||
0 => 'BankAccountTest::testDepositWithdrawMoney'
|
||||
],
|
||||
32 => null
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
protected function getCoverageForFileWithIgnoredLines()
|
||||
{
|
||||
$filter = new Filter;
|
||||
$filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_ignore.php');
|
||||
|
||||
$coverage = new CodeCoverage(
|
||||
$this->setUpXdebugStubForFileWithIgnoredLines(),
|
||||
$filter
|
||||
);
|
||||
|
||||
$coverage->start('FileWithIgnoredLines', true);
|
||||
$coverage->stop();
|
||||
|
||||
return $coverage;
|
||||
}
|
||||
|
||||
protected function setUpXdebugStubForFileWithIgnoredLines()
|
||||
{
|
||||
$stub = $this->createMock(Xdebug::class);
|
||||
|
||||
$stub->expects($this->any())
|
||||
->method('stop')
|
||||
->will($this->returnValue(
|
||||
[
|
||||
TEST_FILES_PATH . 'source_with_ignore.php' => [
|
||||
2 => 1,
|
||||
4 => -1,
|
||||
6 => -1,
|
||||
7 => 1
|
||||
]
|
||||
]
|
||||
));
|
||||
|
||||
return $stub;
|
||||
}
|
||||
|
||||
protected function getCoverageForClassWithAnonymousFunction()
|
||||
{
|
||||
$filter = new Filter;
|
||||
$filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php');
|
||||
|
||||
$coverage = new CodeCoverage(
|
||||
$this->setUpXdebugStubForClassWithAnonymousFunction(),
|
||||
$filter
|
||||
);
|
||||
|
||||
$coverage->start('ClassWithAnonymousFunction', true);
|
||||
$coverage->stop();
|
||||
|
||||
return $coverage;
|
||||
}
|
||||
|
||||
protected function setUpXdebugStubForClassWithAnonymousFunction()
|
||||
{
|
||||
$stub = $this->createMock(Xdebug::class);
|
||||
|
||||
$stub->expects($this->any())
|
||||
->method('stop')
|
||||
->will($this->returnValue(
|
||||
[
|
||||
TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php' => [
|
||||
7 => 1,
|
||||
9 => 1,
|
||||
10 => -1,
|
||||
11 => 1,
|
||||
12 => 1,
|
||||
13 => 1,
|
||||
14 => 1,
|
||||
17 => 1,
|
||||
18 => 1
|
||||
]
|
||||
]
|
||||
));
|
||||
|
||||
return $stub;
|
||||
}
|
||||
}
|
26
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml
vendored
Normal file
26
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-clover.xml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="%i">
|
||||
<project timestamp="%i" name="BankAccount">
|
||||
<file name="%s/BankAccount.php">
|
||||
<class name="BankAccount" namespace="global">
|
||||
<metrics complexity="5" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
|
||||
</class>
|
||||
<line num="6" type="method" name="getBalance" visibility="public" complexity="1" crap="1" count="2"/>
|
||||
<line num="8" type="stmt" count="2"/>
|
||||
<line num="11" type="method" name="setBalance" visibility="protected" complexity="2" crap="6" count="0"/>
|
||||
<line num="13" type="stmt" count="0"/>
|
||||
<line num="14" type="stmt" count="0"/>
|
||||
<line num="15" type="stmt" count="0"/>
|
||||
<line num="16" type="stmt" count="0"/>
|
||||
<line num="18" type="stmt" count="0"/>
|
||||
<line num="20" type="method" name="depositMoney" visibility="public" complexity="1" crap="1" count="2"/>
|
||||
<line num="22" type="stmt" count="2"/>
|
||||
<line num="24" type="stmt" count="1"/>
|
||||
<line num="27" type="method" name="withdrawMoney" visibility="public" complexity="1" crap="1" count="2"/>
|
||||
<line num="29" type="stmt" count="2"/>
|
||||
<line num="31" type="stmt" count="1"/>
|
||||
<metrics loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
|
||||
</file>
|
||||
<metrics files="1" loc="33" ncloc="33" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="5" elements="14" coveredelements="8"/>
|
||||
</project>
|
||||
</coverage>
|
59
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-crap4j.xml
vendored
Normal file
59
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-crap4j.xml
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<crap_result>
|
||||
<project>BankAccount</project>
|
||||
<timestamp>%s</timestamp>
|
||||
<stats>
|
||||
<name>Method Crap Stats</name>
|
||||
<methodCount>4</methodCount>
|
||||
<crapMethodCount>0</crapMethodCount>
|
||||
<crapLoad>0</crapLoad>
|
||||
<totalCrap>9</totalCrap>
|
||||
<crapMethodPercent>0</crapMethodPercent>
|
||||
</stats>
|
||||
<methods>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>BankAccount</className>
|
||||
<methodName>getBalance</methodName>
|
||||
<methodSignature>getBalance()</methodSignature>
|
||||
<fullMethod>getBalance()</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>BankAccount</className>
|
||||
<methodName>setBalance</methodName>
|
||||
<methodSignature>setBalance($balance)</methodSignature>
|
||||
<fullMethod>setBalance($balance)</fullMethod>
|
||||
<crap>6</crap>
|
||||
<complexity>2</complexity>
|
||||
<coverage>0</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>BankAccount</className>
|
||||
<methodName>depositMoney</methodName>
|
||||
<methodSignature>depositMoney($balance)</methodSignature>
|
||||
<fullMethod>depositMoney($balance)</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>BankAccount</className>
|
||||
<methodName>withdrawMoney</methodName>
|
||||
<methodSignature>withdrawMoney($balance)</methodSignature>
|
||||
<fullMethod>withdrawMoney($balance)</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
</methods>
|
||||
</crap_result>
|
12
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-text.txt
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/BankAccount-text.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
Code Coverage Report:
|
||||
%s
|
||||
|
||||
Summary:
|
||||
Classes: 0.00% (0/1)
|
||||
Methods: 75.00% (3/4)
|
||||
Lines: 50.00% (5/10)
|
||||
|
||||
BankAccount
|
||||
Methods: 75.00% ( 3/ 4) Lines: 50.00% ( 5/ 10)
|
33
vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php
vendored
Normal file
33
vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
class BankAccount
|
||||
{
|
||||
protected $balance = 0;
|
||||
|
||||
public function getBalance()
|
||||
{
|
||||
return $this->balance;
|
||||
}
|
||||
|
||||
protected function setBalance($balance)
|
||||
{
|
||||
if ($balance >= 0) {
|
||||
$this->balance = $balance;
|
||||
} else {
|
||||
throw new RuntimeException;
|
||||
}
|
||||
}
|
||||
|
||||
public function depositMoney($balance)
|
||||
{
|
||||
$this->setBalance($this->getBalance() + $balance);
|
||||
|
||||
return $this->getBalance();
|
||||
}
|
||||
|
||||
public function withdrawMoney($balance)
|
||||
{
|
||||
$this->setBalance($this->getBalance() - $balance);
|
||||
|
||||
return $this->getBalance();
|
||||
}
|
||||
}
|
66
vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php
vendored
Normal file
66
vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
require_once 'BankAccount.php';
|
||||
|
||||
class BankAccountTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $ba;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->ba = new BankAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers BankAccount::getBalance
|
||||
*/
|
||||
public function testBalanceIsInitiallyZero()
|
||||
{
|
||||
$this->assertEquals(0, $this->ba->getBalance());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers BankAccount::withdrawMoney
|
||||
*/
|
||||
public function testBalanceCannotBecomeNegative()
|
||||
{
|
||||
try {
|
||||
$this->ba->withdrawMoney(1);
|
||||
} catch (RuntimeException $e) {
|
||||
$this->assertEquals(0, $this->ba->getBalance());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers BankAccount::depositMoney
|
||||
*/
|
||||
public function testBalanceCannotBecomeNegative2()
|
||||
{
|
||||
try {
|
||||
$this->ba->depositMoney(-1);
|
||||
} catch (RuntimeException $e) {
|
||||
$this->assertEquals(0, $this->ba->getBalance());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers BankAccount::getBalance
|
||||
* @covers BankAccount::depositMoney
|
||||
* @covers BankAccount::withdrawMoney
|
||||
*/
|
||||
public function testDepositWithdrawMoney()
|
||||
{
|
||||
$this->assertEquals(0, $this->ba->getBalance());
|
||||
$this->ba->depositMoney(1);
|
||||
$this->assertEquals(1, $this->ba->getBalance());
|
||||
$this->ba->withdrawMoney(1);
|
||||
$this->assertEquals(0, $this->ba->getBalance());
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageClassExtendedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageClassExtendedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass<extended>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageClassTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageClassTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php
vendored
Normal file
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesTest.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class CoverageFunctionParenthesesTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::globalFunction()
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
globalFunction();
|
||||
}
|
||||
}
|
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesWhitespaceTest.php
vendored
Normal file
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionParenthesesWhitespaceTest.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class CoverageFunctionParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::globalFunction ( )
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
globalFunction();
|
||||
}
|
||||
}
|
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionTest.php
vendored
Normal file
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageFunctionTest.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class CoverageFunctionTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::globalFunction
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
globalFunction();
|
||||
}
|
||||
}
|
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodOneLineAnnotationTest.php
vendored
Normal file
11
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodOneLineAnnotationTest.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class CoverageMethodOneLineAnnotationTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @covers CoveredClass::publicMethod */
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageMethodParenthesesTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::publicMethod()
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodParenthesesWhitespaceTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageMethodParenthesesWhitespaceTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::publicMethod ( )
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageMethodTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageMethodTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::publicMethod
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
9
vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php
vendored
Normal file
9
vendor/phpunit/php-code-coverage/tests/_files/CoverageNoneTest.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
class CoverageNoneTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPrivateTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageNotPrivateTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<!private>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotProtectedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageNotProtectedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<!protected>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageNotPublicTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageNotPublicTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<!public>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
13
vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php
vendored
Normal file
13
vendor/phpunit/php-code-coverage/tests/_files/CoverageNothingTest.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class CoverageNothingTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::publicMethod
|
||||
* @coversNothing
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoveragePrivateTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoveragePrivateTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<private>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoverageProtectedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoverageProtectedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<protected>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/CoveragePublicTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class CoveragePublicTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers CoveredClass::<public>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
18
vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php
vendored
Normal file
18
vendor/phpunit/php-code-coverage/tests/_files/CoverageTwoDefaultClassAnnotations.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \NamespaceOne
|
||||
* @coversDefaultClass \AnotherDefault\Name\Space\Does\Not\Work
|
||||
*/
|
||||
class CoverageTwoDefaultClassAnnotations
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<public>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
|
||||
}
|
36
vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php
vendored
Normal file
36
vendor/phpunit/php-code-coverage/tests/_files/CoveredClass.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
class CoveredParentClass
|
||||
{
|
||||
private function privateMethod()
|
||||
{
|
||||
}
|
||||
|
||||
protected function protectedMethod()
|
||||
{
|
||||
$this->privateMethod();
|
||||
}
|
||||
|
||||
public function publicMethod()
|
||||
{
|
||||
$this->protectedMethod();
|
||||
}
|
||||
}
|
||||
|
||||
class CoveredClass extends CoveredParentClass
|
||||
{
|
||||
private function privateMethod()
|
||||
{
|
||||
}
|
||||
|
||||
protected function protectedMethod()
|
||||
{
|
||||
parent::protectedMethod();
|
||||
$this->privateMethod();
|
||||
}
|
||||
|
||||
public function publicMethod()
|
||||
{
|
||||
parent::publicMethod();
|
||||
$this->protectedMethod();
|
||||
}
|
||||
}
|
4
vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php
vendored
Normal file
4
vendor/phpunit/php-code-coverage/tests/_files/CoveredFunction.php
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
function globalFunction()
|
||||
{
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassExtendedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassExtendedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageClassExtendedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass<extended>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageClassTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageClassTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
15
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php
vendored
Normal file
15
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassPublicTest.php
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @coversDefaultClass \Foo\CoveredClass
|
||||
*/
|
||||
class NamespaceCoverageCoversClassPublicTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::publicMethod
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
20
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php
vendored
Normal file
20
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageCoversClassTest.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* @coversDefaultClass \Foo\CoveredClass
|
||||
*/
|
||||
class NamespaceCoverageCoversClassTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::privateMethod
|
||||
* @covers ::protectedMethod
|
||||
* @covers ::publicMethod
|
||||
* @covers \Foo\CoveredParentClass::privateMethod
|
||||
* @covers \Foo\CoveredParentClass::protectedMethod
|
||||
* @covers \Foo\CoveredParentClass::publicMethod
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageMethodTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageMethodTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::publicMethod
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPrivateTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageNotPrivateTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<!private>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotProtectedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageNotProtectedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<!protected>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageNotPublicTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageNotPublicTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<!public>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePrivateTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoveragePrivateTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<private>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoverageProtectedTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoverageProtectedTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<protected>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class NamespaceCoveragePublicTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Foo\CoveredClass::<public>
|
||||
*/
|
||||
public function testSomething()
|
||||
{
|
||||
$o = new Foo\CoveredClass;
|
||||
$o->publicMethod();
|
||||
}
|
||||
}
|
38
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php
vendored
Normal file
38
vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveredClass.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Foo;
|
||||
|
||||
class CoveredParentClass
|
||||
{
|
||||
private function privateMethod()
|
||||
{
|
||||
}
|
||||
|
||||
protected function protectedMethod()
|
||||
{
|
||||
$this->privateMethod();
|
||||
}
|
||||
|
||||
public function publicMethod()
|
||||
{
|
||||
$this->protectedMethod();
|
||||
}
|
||||
}
|
||||
|
||||
class CoveredClass extends CoveredParentClass
|
||||
{
|
||||
private function privateMethod()
|
||||
{
|
||||
}
|
||||
|
||||
protected function protectedMethod()
|
||||
{
|
||||
parent::protectedMethod();
|
||||
$this->privateMethod();
|
||||
}
|
||||
|
||||
public function publicMethod()
|
||||
{
|
||||
parent::publicMethod();
|
||||
$this->protectedMethod();
|
||||
}
|
||||
}
|
24
vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php
vendored
Normal file
24
vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
class NotExistingCoveredElementTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers NotExistingClass
|
||||
*/
|
||||
public function testOne()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers NotExistingClass::notExistingMethod
|
||||
*/
|
||||
public function testTwo()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers NotExistingClass::<public>
|
||||
*/
|
||||
public function testThree()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,267 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s/BankAccount.php</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">BankAccount.php</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="danger">Total</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
|
||||
<span class="sr-only">75.00% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">75.00%</div></td>
|
||||
<td class="warning small"><div align="right">3 / 4</div></td>
|
||||
<td class="warning small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">5 / 10</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger">BankAccount</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
|
||||
<span class="sr-only">75.00% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">75.00%</div></td>
|
||||
<td class="warning small"><div align="right">3 / 4</div></td>
|
||||
<td class="warning small">8.12</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">5 / 10</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#6"><abbr title="getBalance()">getBalance</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger" colspan="4"> <a href="#11"><abbr title="setBalance($balance)">setBalance</abbr></a></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="danger small">6</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 5</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#20"><abbr title="depositMoney($balance)">depositMoney</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">2 / 2</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#27"><abbr title="withdrawMoney($balance)">withdrawMoney</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">2 / 2</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="code" class="table table-borderless table-condensed">
|
||||
<tbody>
|
||||
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default"><?php</span></td></tr>
|
||||
<tr><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default"> </span><span class="default">BankAccount</span></td></tr>
|
||||
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">protected</span><span class="default"> </span><span class="default">$balance</span><span class="default"> </span><span class="keyword">=</span><span class="default"> </span><span class="default">0</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="2 tests cover line 8" data-content="<ul><li class="covered-by-large-tests">BankAccountTest::testBalanceIsInitiallyZero</li><li class="covered-by-large-tests">BankAccountTest::testDepositWithdrawMoney</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">return</span><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">balance</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="warning"><td><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">protected</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">if</span><span class="default"> </span><span class="keyword">(</span><span class="default">$balance</span><span class="default"> </span><span class="default">>=</span><span class="default"> </span><span class="default">0</span><span class="keyword">)</span><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">balance</span><span class="default"> </span><span class="keyword">=</span><span class="default"> </span><span class="default">$balance</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span><span class="default"> </span><span class="keyword">else</span><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">throw</span><span class="default"> </span><span class="keyword">new</span><span class="default"> </span><span class="default">RuntimeException</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="20"></a><a href="#20">20</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">depositMoney</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="21"></a><a href="#21">21</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="2 tests cover line 22" data-content="<ul><li class="covered-by-large-tests">BankAccountTest::testBalanceCannotBecomeNegative2</li><li class="covered-by-large-tests">BankAccountTest::testDepositWithdrawMoney</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="22"></a><a href="#22">22</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$this</span><span class="default">-></span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="default"> </span><span class="keyword">+</span><span class="default"> </span><span class="default">$balance</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="23"></a><a href="#23">23</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 24" data-content="<ul><li class="covered-by-large-tests">BankAccountTest::testDepositWithdrawMoney</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="24"></a><a href="#24">24</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">return</span><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="warning"><td><div align="right"><a name="25"></a><a href="#25">25</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="26"></a><a href="#26">26</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="27"></a><a href="#27">27</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">withdrawMoney</span><span class="keyword">(</span><span class="default">$balance</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="28"></a><a href="#28">28</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="2 tests cover line 29" data-content="<ul><li class="covered-by-large-tests">BankAccountTest::testBalanceCannotBecomeNegative</li><li class="covered-by-large-tests">BankAccountTest::testDepositWithdrawMoney</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="29"></a><a href="#29">29</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">setBalance</span><span class="keyword">(</span><span class="default">$this</span><span class="default">-></span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="default"> </span><span class="keyword">-</span><span class="default"> </span><span class="default">$balance</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="30"></a><a href="#30">30</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 31" data-content="<ul><li class="covered-by-large-tests">BankAccountTest::testDepositWithdrawMoney</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="31"></a><a href="#31">31</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">return</span><span class="default"> </span><span class="default">$this</span><span class="default">-></span><span class="default">getBalance</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="warning"><td><div align="right"><a name="32"></a><a href="#32">32</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="33"></a><a href="#33">33</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="success"><strong>Executed</strong></span>
|
||||
<span class="danger"><strong>Not Executed</strong></span>
|
||||
<span class="warning"><strong>Dead Code</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var $window = $(window)
|
||||
, $top_link = $('#toplink')
|
||||
, $body = $('body, html')
|
||||
, offset = $('#code').offset().top;
|
||||
|
||||
$top_link.hide().click(function(event) {
|
||||
event.preventDefault();
|
||||
$body.animate({scrollTop:0}, 800);
|
||||
});
|
||||
|
||||
$window.scroll(function() {
|
||||
if($window.scrollTop() > offset) {
|
||||
$top_link.fadeIn();
|
||||
} else {
|
||||
$top_link.fadeOut();
|
||||
}
|
||||
}).scroll();
|
||||
|
||||
$('.popin').popover({trigger: 'hover'});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
290
vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html
vendored
Normal file
290
vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/dashboard.html
vendored
Normal file
@ -0,0 +1,290 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/nv.d3.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">(Dashboard)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Classes</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="classCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="classComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="BankAccount.php.html#2">BankAccount</a></td><td class="text-right">50%</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="BankAccount.php.html#2">BankAccount</a></td><td class="text-right">8</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Methods</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="methodCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="methodComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="BankAccount.php.html#11"><abbr title="BankAccount::setBalance">setBalance</abbr></a></td><td class="text-right">0%</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="BankAccount.php.html#11"><abbr title="BankAccount::setBalance">setBalance</abbr></a></td><td class="text-right">6</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<hr/>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script src="js/d3.min.js" type="text/javascript"></script>
|
||||
<script src="js/nv.d3.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#classCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([0,0,0,0,0,0,1,0,0,0,0,0], "Class Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#methodCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([1,0,0,0,0,0,0,0,0,0,0,3], "Method Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getCoverageDistributionData(data, label) {
|
||||
var labels = [
|
||||
'0%',
|
||||
'0-10%',
|
||||
'10-20%',
|
||||
'20-30%',
|
||||
'30-40%',
|
||||
'40-50%',
|
||||
'50-60%',
|
||||
'60-70%',
|
||||
'70-80%',
|
||||
'80-90%',
|
||||
'90-100%',
|
||||
'100%'
|
||||
];
|
||||
var values = [];
|
||||
$.each(labels, function(key) {
|
||||
values.push({x: labels[key], y: data[key]});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Cyclomatic Complexity');
|
||||
|
||||
d3.select('#classComplexity svg')
|
||||
.datum(getComplexityData([[50,5,"<a href=\"BankAccount.php.html#2\">BankAccount<\/a>"]], 'Class Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Method Complexity');
|
||||
|
||||
d3.select('#methodComplexity svg')
|
||||
.datum(getComplexityData([[100,1,"<a href=\"BankAccount.php.html#6\">BankAccount::getBalance<\/a>"],[0,2,"<a href=\"BankAccount.php.html#11\">BankAccount::setBalance<\/a>"],[100,1,"<a href=\"BankAccount.php.html#20\">BankAccount::depositMoney<\/a>"],[100,1,"<a href=\"BankAccount.php.html#27\">BankAccount::withdrawMoney<\/a>"]], 'Method Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getComplexityData(data, label) {
|
||||
var values = [];
|
||||
$.each(data, function(key) {
|
||||
var value = Math.round(data[key][0]*100) / 100;
|
||||
values.push({
|
||||
x: value,
|
||||
y: data[key][1],
|
||||
class: data[key][2],
|
||||
size: 0.05,
|
||||
shape: 'diamond'
|
||||
});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
119
vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/index.html
vendored
Normal file
119
vendor/phpunit/php-code-coverage/tests/_files/Report/HTML/CoverageForBankAccount/index.html
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">%s</li>
|
||||
<li>(<a href="dashboard.html">Dashboard</a>)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="danger">Total</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">5 / 10</div></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
|
||||
<span class="sr-only">75.00% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">75.00%</div></td>
|
||||
<td class="warning small"><div align="right">3 / 4</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger"><span class="glyphicon glyphicon-file"></span> <a href="BankAccount.php.html">BankAccount.php</a></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">5 / 10</div></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="75.00" aria-valuemin="0" aria-valuemax="100" style="width: 75.00%">
|
||||
<span class="sr-only">75.00% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">75.00%</div></td>
|
||||
<td class="warning small"><div align="right">3 / 4</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
|
||||
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
|
||||
<span class="success"><strong>High</strong>: 90% to 100%</span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,288 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/nv.d3.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">(Dashboard)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Classes</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="classCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="classComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="source_with_class_and_anonymous_function.php.html#3">CoveredClassWithAnonymousFunctionInStaticMethod</a></td><td class="text-right">87%</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Methods</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="methodCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="methodComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td><a href="source_with_class_and_anonymous_function.php.html#5"><abbr title="CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous">runAnonymous</abbr></a></td><td class="text-right">66%</td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<hr/>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script src="js/d3.min.js" type="text/javascript"></script>
|
||||
<script src="js/nv.d3.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#classCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,1,0,0], "Class Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#methodCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,1,0,0,0,1], "Method Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getCoverageDistributionData(data, label) {
|
||||
var labels = [
|
||||
'0%',
|
||||
'0-10%',
|
||||
'10-20%',
|
||||
'20-30%',
|
||||
'30-40%',
|
||||
'40-50%',
|
||||
'50-60%',
|
||||
'60-70%',
|
||||
'70-80%',
|
||||
'80-90%',
|
||||
'90-100%',
|
||||
'100%'
|
||||
];
|
||||
var values = [];
|
||||
$.each(labels, function(key) {
|
||||
values.push({x: labels[key], y: data[key]});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Cyclomatic Complexity');
|
||||
|
||||
d3.select('#classComplexity svg')
|
||||
.datum(getComplexityData([[87.5,2,"<a href=\"source_with_class_and_anonymous_function.php.html#3\">CoveredClassWithAnonymousFunctionInStaticMethod<\/a>"]], 'Class Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Method Complexity');
|
||||
|
||||
d3.select('#methodComplexity svg')
|
||||
.datum(getComplexityData([[66.666666666667,1,"<a href=\"source_with_class_and_anonymous_function.php.html#5\">CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous<\/a>"],[100,1,"<a href=\"source_with_class_and_anonymous_function.php.html#11\">CoveredClassWithAnonymousFunctionInStaticMethod::anonymous function<\/a>"]], 'Method Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getComplexityData(data, label) {
|
||||
var values = [];
|
||||
$.each(data, function(key) {
|
||||
var value = Math.round(data[key][0]*100) / 100;
|
||||
values.push({
|
||||
x: value,
|
||||
y: data[key][1],
|
||||
class: data[key][2],
|
||||
size: 0.05,
|
||||
shape: 'diamond'
|
||||
});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">%s</li>
|
||||
<li>(<a href="dashboard.html">Dashboard</a>)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="warning">Total</td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
|
||||
<span class="sr-only">87.50% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">87.50%</div></td>
|
||||
<td class="warning small"><div align="right">7 / 8</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="warning"><span class="glyphicon glyphicon-file"></span> <a href="source_with_class_and_anonymous_function.php.html">source_with_class_and_anonymous_function.php</a></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
|
||||
<span class="sr-only">87.50% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">87.50%</div></td>
|
||||
<td class="warning small"><div align="right">7 / 8</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
|
||||
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
|
||||
<span class="success"><strong>High</strong>: 90% to 100%</span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,211 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s/source_with_class_and_anonymous_function.php</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">source_with_class_and_anonymous_function.php</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="danger">Total</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class="danger small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
|
||||
<span class="sr-only">87.50% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">87.50%</div></td>
|
||||
<td class="warning small"><div align="right">7 / 8</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger">CoveredClassWithAnonymousFunctionInStaticMethod</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class="danger small">2.01</td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
|
||||
<span class="sr-only">87.50% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">87.50%</div></td>
|
||||
<td class="warning small"><div align="right">7 / 8</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger" colspan="4"> <a href="#5"><abbr title="runAnonymous()">runAnonymous</abbr></a></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
|
||||
<span class="sr-only">0.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">0.00%</div></td>
|
||||
<td class="danger small"><div align="right">0 / 1</div></td>
|
||||
<td class="danger small">1.04</td>
|
||||
<td class="warning big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="66.67" aria-valuemin="0" aria-valuemax="100" style="width: 66.67%">
|
||||
<span class="sr-only">66.67% covered (warning)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="warning small"><div align="right">66.67%</div></td>
|
||||
<td class="warning small"><div align="right">2 / 3</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#11"><abbr title="anonymous function (&$val, $key)">anonymous function</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">2 / 2</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="code" class="table table-borderless table-condensed">
|
||||
<tbody>
|
||||
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default"><?php</span></td></tr>
|
||||
<tr><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default"> </span><span class="default">CoveredClassWithAnonymousFunctionInStaticMethod</span></td></tr>
|
||||
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">static</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">runAnonymous</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 7" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$filter</span><span class="default"> </span><span class="keyword">=</span><span class="default"> </span><span class="keyword">[</span><span class="default">'abc124'</span><span class="keyword">,</span><span class="default"> </span><span class="default">'abc123'</span><span class="keyword">,</span><span class="default"> </span><span class="default">'123'</span><span class="keyword">]</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 9" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">array_walk</span><span class="keyword">(</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$filter</span><span class="keyword">,</span></td></tr>
|
||||
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="keyword">(</span><span class="keyword">&</span><span class="default">$val</span><span class="keyword">,</span><span class="default"> </span><span class="default">$key</span><span class="keyword">)</span><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 12" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$val</span><span class="default"> </span><span class="keyword">=</span><span class="default"> </span><span class="default">preg_replace</span><span class="keyword">(</span><span class="default">'|[^0-9]|'</span><span class="keyword">,</span><span class="default"> </span><span class="default">''</span><span class="keyword">,</span><span class="default"> </span><span class="default">$val</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 13" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 14" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="default"> </span><span class="comment">// Should be covered</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 17" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">$extravar</span><span class="default"> </span><span class="keyword">=</span><span class="default"> </span><span class="default">true</span><span class="keyword">;</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 18" data-content="<ul><li class="covered-by-large-tests">ClassWithAnonymousFunction</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="success"><strong>Executed</strong></span>
|
||||
<span class="danger"><strong>Not Executed</strong></span>
|
||||
<span class="warning"><strong>Dead Code</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var $window = $(window)
|
||||
, $top_link = $('#toplink')
|
||||
, $body = $('body, html')
|
||||
, offset = $('#code').offset().top;
|
||||
|
||||
$top_link.hide().click(function(event) {
|
||||
event.preventDefault();
|
||||
$body.animate({scrollTop:0}, 800);
|
||||
});
|
||||
|
||||
$window.scroll(function() {
|
||||
if($window.scrollTop() > offset) {
|
||||
$top_link.fadeIn();
|
||||
} else {
|
||||
$top_link.fadeOut();
|
||||
}
|
||||
}).scroll();
|
||||
|
||||
$('.popin').popover({trigger: 'hover'});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,286 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/nv.d3.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">(Dashboard)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Classes</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="classCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="classComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Methods</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Coverage Distribution</h3>
|
||||
<div id="methodCoverageDistribution" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Complexity</h3>
|
||||
<div id="methodComplexity" style="height: 300px;">
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3>Insufficient Coverage</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right">Coverage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h3>Project Risks</h3>
|
||||
<div class="scrollbox">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Method</th>
|
||||
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<hr/>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script src="js/d3.min.js" type="text/javascript"></script>
|
||||
<script src="js/nv.d3.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#classCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,2], "Class Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.multiBarChart();
|
||||
chart.tooltips(false)
|
||||
.showControls(false)
|
||||
.showLegend(false)
|
||||
.reduceXTicks(false)
|
||||
.staggerLabels(true)
|
||||
.yAxis.tickFormat(d3.format('d'));
|
||||
|
||||
d3.select('#methodCoverageDistribution svg')
|
||||
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,2], "Method Coverage"))
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getCoverageDistributionData(data, label) {
|
||||
var labels = [
|
||||
'0%',
|
||||
'0-10%',
|
||||
'10-20%',
|
||||
'20-30%',
|
||||
'30-40%',
|
||||
'40-50%',
|
||||
'50-60%',
|
||||
'60-70%',
|
||||
'70-80%',
|
||||
'80-90%',
|
||||
'90-100%',
|
||||
'100%'
|
||||
];
|
||||
var values = [];
|
||||
$.each(labels, function(key) {
|
||||
values.push({x: labels[key], y: data[key]});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Cyclomatic Complexity');
|
||||
|
||||
d3.select('#classComplexity svg')
|
||||
.datum(getComplexityData([[100,1,"<a href=\"source_with_ignore.php.html#11\">Foo<\/a>"],[100,1,"<a href=\"source_with_ignore.php.html#18\">Bar<\/a>"]], 'Class Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.showLegend(false)
|
||||
.forceX([0, 100]);
|
||||
chart.tooltipContent(function(graph) {
|
||||
return '<p>' + graph.point.class + '</p>';
|
||||
});
|
||||
|
||||
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
||||
chart.yAxis.axisLabel('Method Complexity');
|
||||
|
||||
d3.select('#methodComplexity svg')
|
||||
.datum(getComplexityData([[100,1,"<a href=\"source_with_ignore.php.html#13\">Foo::bar<\/a>"],[100,1,"<a href=\"source_with_ignore.php.html#23\">Bar::foo<\/a>"]], 'Method Complexity'))
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
function getComplexityData(data, label) {
|
||||
var values = [];
|
||||
$.each(data, function(key) {
|
||||
var value = Math.round(data[key][0]*100) / 100;
|
||||
values.push({
|
||||
x: value,
|
||||
y: data[key][1],
|
||||
class: data[key][2],
|
||||
size: 0.05,
|
||||
shape: 'diamond'
|
||||
});
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
key: label,
|
||||
values: values,
|
||||
color: "#4572A7"
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">%s</li>
|
||||
<li>(<a href="dashboard.html">Dashboard</a>)</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="9"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="danger">Total</td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="danger"><span class="glyphicon glyphicon-file"></span> <a href="source_with_ignore.php.html">source_with_ignore.php</a></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="danger"><strong>Low</strong>: 0% to 50%</span>
|
||||
<span class="warning"><strong>Medium</strong>: 50% to 90%</span>
|
||||
<span class="success"><strong>High</strong>: 90% to 100%</span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,234 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Code Coverage for %s</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/style.css" rel="stylesheet">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
<script src="js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="index.html">%s</a></li>
|
||||
<li class="active">source_with_ignore.php</li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="10"><div align="center"><strong>Code Coverage</strong></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3"><div align="center"><strong>Classes and Traits</strong></div></td>
|
||||
<td colspan="4"><div align="center"><strong>Functions and Methods</strong></div></td>
|
||||
<td colspan="3"><div align="center"><strong>Lines</strong></div></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="">Total</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class=" small"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></td>
|
||||
<td class="danger big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
|
||||
<span class="sr-only">50.00% covered (danger)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="danger small"><div align="right">50.00%</div></td>
|
||||
<td class="danger small"><div align="right">1 / 2</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"><a href="#28"><abbr title="baz()">baz</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">0</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="">Foo</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#13"><abbr title="bar()">bar</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="">Bar</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="success" colspan="4"> <a href="#23"><abbr title="foo()">foo</abbr></a></td>
|
||||
<td class="success big"> <div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100.00" aria-valuemin="0" aria-valuemax="100" style="width: 100.00%">
|
||||
<span class="sr-only">100.00% covered (success)</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="success small"><div align="right">100.00%</div></td>
|
||||
<td class="success small"><div align="right">1 / 1</div></td>
|
||||
<td class="success small">1</td>
|
||||
<td class=" big"></td>
|
||||
<td class=" small"><div align="right">n/a</div></td>
|
||||
<td class=" small"><div align="right">0 / 0</div></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="code" class="table table-borderless table-condensed">
|
||||
<tbody>
|
||||
<tr><td><div align="right"><a name="1"></a><a href="#1">1</a></div></td><td class="codeLine"><span class="default"><?php</span></td></tr>
|
||||
<tr class="covered-by-large-tests popin" data-title="1 test covers line 2" data-content="<ul><li class="covered-by-large-tests">FileWithIgnoredLines</li></ul>" data-placement="bottom" data-html="true"><td><div align="right"><a name="2"></a><a href="#2">2</a></div></td><td class="codeLine"><span class="keyword">if</span><span class="default"> </span><span class="keyword">(</span><span class="default">$neverHappens</span><span class="keyword">)</span><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="3"></a><a href="#3">3</a></div></td><td class="codeLine"><span class="default"> </span><span class="comment">// @codeCoverageIgnoreStart</span></td></tr>
|
||||
<tr><td><div align="right"><a name="4"></a><a href="#4">4</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">print</span><span class="default"> </span><span class="default">'*'</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="5"></a><a href="#5">5</a></div></td><td class="codeLine"><span class="default"> </span><span class="comment">// @codeCoverageIgnoreEnd</span></td></tr>
|
||||
<tr class="danger"><td><div align="right"><a name="6"></a><a href="#6">6</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="7"></a><a href="#7">7</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="8"></a><a href="#8">8</a></div></td><td class="codeLine"><span class="comment">/**</span></td></tr>
|
||||
<tr><td><div align="right"><a name="9"></a><a href="#9">9</a></div></td><td class="codeLine"><span class="comment"> * @codeCoverageIgnore</span></td></tr>
|
||||
<tr><td><div align="right"><a name="10"></a><a href="#10">10</a></div></td><td class="codeLine"><span class="comment"> */</span></td></tr>
|
||||
<tr><td><div align="right"><a name="11"></a><a href="#11">11</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default"> </span><span class="default">Foo</span></td></tr>
|
||||
<tr><td><div align="right"><a name="12"></a><a href="#12">12</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="13"></a><a href="#13">13</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">bar</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="14"></a><a href="#14">14</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="15"></a><a href="#15">15</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="16"></a><a href="#16">16</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="17"></a><a href="#17">17</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="18"></a><a href="#18">18</a></div></td><td class="codeLine"><span class="keyword">class</span><span class="default"> </span><span class="default">Bar</span></td></tr>
|
||||
<tr><td><div align="right"><a name="19"></a><a href="#19">19</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="20"></a><a href="#20">20</a></div></td><td class="codeLine"><span class="default"> </span><span class="comment">/**</span></td></tr>
|
||||
<tr><td><div align="right"><a name="21"></a><a href="#21">21</a></div></td><td class="codeLine"><span class="comment"> * @codeCoverageIgnore</span></td></tr>
|
||||
<tr><td><div align="right"><a name="22"></a><a href="#22">22</a></div></td><td class="codeLine"><span class="comment"> */</span></td></tr>
|
||||
<tr><td><div align="right"><a name="23"></a><a href="#23">23</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">foo</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="24"></a><a href="#24">24</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="25"></a><a href="#25">25</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="26"></a><a href="#26">26</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="27"></a><a href="#27">27</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="28"></a><a href="#28">28</a></div></td><td class="codeLine"><span class="keyword">function</span><span class="default"> </span><span class="default">baz</span><span class="keyword">(</span><span class="keyword">)</span></td></tr>
|
||||
<tr><td><div align="right"><a name="29"></a><a href="#29">29</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="30"></a><a href="#30">30</a></div></td><td class="codeLine"><span class="default"> </span><span class="default">print</span><span class="default"> </span><span class="default">'*'</span><span class="keyword">;</span><span class="default"> </span><span class="comment">// @codeCoverageIgnore</span></td></tr>
|
||||
<tr><td><div align="right"><a name="31"></a><a href="#31">31</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
<tr><td><div align="right"><a name="32"></a><a href="#32">32</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="33"></a><a href="#33">33</a></div></td><td class="codeLine"><span class="keyword">interface</span><span class="default"> </span><span class="default">Bor</span></td></tr>
|
||||
<tr><td><div align="right"><a name="34"></a><a href="#34">34</a></div></td><td class="codeLine"><span class="keyword">{</span></td></tr>
|
||||
<tr><td><div align="right"><a name="35"></a><a href="#35">35</a></div></td><td class="codeLine"><span class="default"> </span><span class="keyword">public</span><span class="default"> </span><span class="keyword">function</span><span class="default"> </span><span class="default">foo</span><span class="keyword">(</span><span class="keyword">)</span><span class="keyword">;</span></td></tr>
|
||||
<tr><td><div align="right"><a name="36"></a><a href="#36">36</a></div></td><td class="codeLine"></td></tr>
|
||||
<tr><td><div align="right"><a name="37"></a><a href="#37">37</a></div></td><td class="codeLine"><span class="keyword">}</span></td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
<hr/>
|
||||
<h4>Legend</h4>
|
||||
<p>
|
||||
<span class="success"><strong>Executed</strong></span>
|
||||
<span class="danger"><strong>Not Executed</strong></span>
|
||||
<span class="warning"><strong>Dead Code</strong></span>
|
||||
</p>
|
||||
<p>
|
||||
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small>
|
||||
</p>
|
||||
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
|
||||
</footer>
|
||||
</div>
|
||||
<script src="js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="js/holder.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var $window = $(window)
|
||||
, $top_link = $('#toplink')
|
||||
, $body = $('body, html')
|
||||
, offset = $('#code').offset().top;
|
||||
|
||||
$top_link.hide().click(function(event) {
|
||||
event.preventDefault();
|
||||
$body.animate({scrollTop:0}, 800);
|
||||
});
|
||||
|
||||
$window.scroll(function() {
|
||||
if($window.scrollTop() > offset) {
|
||||
$top_link.fadeIn();
|
||||
} else {
|
||||
$top_link.fadeOut();
|
||||
}
|
||||
}).scroll();
|
||||
|
||||
$('.popin').popover({trigger: 'hover'});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<file name="BankAccount.php">
|
||||
<totals>
|
||||
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00%"/>
|
||||
<methods count="4" tested="3" percent="75.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<class name="BankAccount" start="2" executable="10" executed="5" crap="8.12">
|
||||
<package full="" name="" sub="" category=""/>
|
||||
<namespace name=""/>
|
||||
<method name="getBalance" signature="getBalance()" start="6" end="9" crap="1" executable="1" executed="1" coverage="100"/>
|
||||
<method name="setBalance" signature="setBalance($balance)" start="11" end="18" crap="6" executable="5" executed="0" coverage="0"/>
|
||||
<method name="depositMoney" signature="depositMoney($balance)" start="20" end="25" crap="1" executable="2" executed="2" coverage="100"/>
|
||||
<method name="withdrawMoney" signature="withdrawMoney($balance)" start="27" end="32" crap="1" executable="2" executed="2" coverage="100"/>
|
||||
</class>
|
||||
<coverage>
|
||||
<line nr="8">
|
||||
<covered by="BankAccountTest::testBalanceIsInitiallyZero"/>
|
||||
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
|
||||
</line>
|
||||
<line nr="22">
|
||||
<covered by="BankAccountTest::testBalanceCannotBecomeNegative2"/>
|
||||
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
|
||||
</line>
|
||||
<line nr="24">
|
||||
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
|
||||
</line>
|
||||
<line nr="29">
|
||||
<covered by="BankAccountTest::testBalanceCannotBecomeNegative"/>
|
||||
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
|
||||
</line>
|
||||
<line nr="31">
|
||||
<covered by="BankAccountTest::testDepositWithdrawMoney"/>
|
||||
</line>
|
||||
</coverage>
|
||||
</file>
|
||||
</phpunit>
|
29
vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/index.xml
vendored
Normal file
29
vendor/phpunit/php-code-coverage/tests/_files/Report/XML/CoverageForBankAccount/index.xml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<project name="%s">
|
||||
<tests>
|
||||
<test name="BankAccountTest::testBalanceIsInitiallyZero" size="unknown" result="0" status="PASSED"/>
|
||||
<test name="BankAccountTest::testBalanceCannotBecomeNegative" size="unknown" result="0" status="PASSED"/>
|
||||
<test name="BankAccountTest::testBalanceCannotBecomeNegative2" size="unknown" result="0" status="PASSED"/>
|
||||
<test name="BankAccountTest::testDepositWithdrawMoney" size="unknown" result="0" status="PASSED"/>
|
||||
</tests>
|
||||
<directory name="%s">
|
||||
<totals>
|
||||
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00%"/>
|
||||
<methods count="4" tested="3" percent="75.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<file name="BankAccount.php" href="BankAccount.php.xml">
|
||||
<totals>
|
||||
<lines total="33" comments="0" code="33" executable="10" executed="5" percent="50.00%"/>
|
||||
<methods count="4" tested="3" percent="75.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
</file>
|
||||
</directory>
|
||||
</project>
|
||||
</phpunit>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<project name="%s">
|
||||
<tests>
|
||||
<test name="ClassWithAnonymousFunction" size="unknown" result="0" status="PASSED"/>
|
||||
</tests>
|
||||
<directory name="%s">
|
||||
<totals>
|
||||
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50%"/>
|
||||
<methods count="2" tested="1" percent="50.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<file name="source_with_class_and_anonymous_function.php" href="source_with_class_and_anonymous_function.php.xml">
|
||||
<totals>
|
||||
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50%"/>
|
||||
<methods count="2" tested="1" percent="50.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
</file>
|
||||
</directory>
|
||||
</project>
|
||||
</phpunit>
|
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<file name="source_with_class_and_anonymous_function.php">
|
||||
<totals>
|
||||
<lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50%"/>
|
||||
<methods count="2" tested="1" percent="50.00%"/>
|
||||
<functions count="0" tested="0" percent=""/>
|
||||
<classes count="1" tested="0" percent="0.00%"/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<class name="CoveredClassWithAnonymousFunctionInStaticMethod" start="3" executable="8" executed="7" crap="2.01">
|
||||
<package full="" name="" sub="" category=""/>
|
||||
<namespace name=""/>
|
||||
<method name="runAnonymous" signature="runAnonymous()" start="5" end="18" crap="1.04" executable="3" executed="2" coverage="66.666666666667"/>
|
||||
<method name="anonymous function" signature="anonymous function (&$val, $key)" start="11" end="13" crap="1" executable="2" executed="2" coverage="100"/>
|
||||
</class>
|
||||
<coverage>
|
||||
<line nr="7">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="9">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="12">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="13">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="14">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="17">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
<line nr="18">
|
||||
<covered by="ClassWithAnonymousFunction"/>
|
||||
</line>
|
||||
</coverage>
|
||||
</file>
|
||||
</phpunit>
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<project name="%s">
|
||||
<tests>
|
||||
<test name="FileWithIgnoredLines" size="unknown" result="0" status="PASSED"/>
|
||||
</tests>
|
||||
<directory name="%s">
|
||||
<totals>
|
||||
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00%"/>
|
||||
<methods count="0" tested="0" percent=""/>
|
||||
<functions count="1" tested="0" percent="0.00%"/>
|
||||
<classes count="0" tested="0" percent=""/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<file name="source_with_ignore.php" href="source_with_ignore.php.xml">
|
||||
<totals>
|
||||
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00%"/>
|
||||
<methods count="0" tested="0" percent=""/>
|
||||
<functions count="1" tested="0" percent="0.00%"/>
|
||||
<classes count="0" tested="0" percent=""/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
</file>
|
||||
</directory>
|
||||
</project>
|
||||
</phpunit>
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns="http://schema.phpunit.de/coverage/1.0">
|
||||
<file name="source_with_ignore.php">
|
||||
<totals>
|
||||
<lines total="37" comments="12" code="25" executable="2" executed="1" percent="50.00%"/>
|
||||
<methods count="0" tested="0" percent=""/>
|
||||
<functions count="1" tested="0" percent="0.00%"/>
|
||||
<classes count="0" tested="0" percent=""/>
|
||||
<traits count="0" tested="0" percent=""/>
|
||||
</totals>
|
||||
<class name="Foo" start="11" executable="0" executed="0" crap="1">
|
||||
<package full="" name="" sub="" category=""/>
|
||||
<namespace name=""/>
|
||||
<method name="bar" signature="bar()" start="13" end="15" crap="1" executable="0" executed="0" coverage="100"/>
|
||||
</class>
|
||||
<class name="Bar" start="18" executable="0" executed="0" crap="1">
|
||||
<package full="" name="" sub="" category=""/>
|
||||
<namespace name=""/>
|
||||
<method name="foo" signature="foo()" start="23" end="25" crap="1" executable="0" executed="0" coverage="100"/>
|
||||
</class>
|
||||
<function name="baz" signature="baz()" start="28" crap="0" executable="0" executed="0" coverage="0"/>
|
||||
<coverage>
|
||||
<line nr="2">
|
||||
<covered by="FileWithIgnoredLines"/>
|
||||
</line>
|
||||
</coverage>
|
||||
</file>
|
||||
</phpunit>
|
22
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml
vendored
Normal file
22
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-clover.xml
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="%i">
|
||||
<project timestamp="%i">
|
||||
<file name="%s/source_with_class_and_anonymous_function.php">
|
||||
<class name="CoveredClassWithAnonymousFunctionInStaticMethod" namespace="global">
|
||||
<metrics complexity="2" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="4" elements="7" coveredelements="5"/>
|
||||
</class>
|
||||
<line num="5" type="method" name="runAnonymous" visibility="public" complexity="1" crap="1.04" count="1"/>
|
||||
<line num="7" type="stmt" count="1"/>
|
||||
<line num="9" type="stmt" count="1"/>
|
||||
<line num="10" type="stmt" count="0"/>
|
||||
<line num="11" type="method" name="anonymous function" complexity="1" crap="1" count="1"/>
|
||||
<line num="12" type="stmt" count="1"/>
|
||||
<line num="13" type="stmt" count="1"/>
|
||||
<line num="14" type="stmt" count="1"/>
|
||||
<line num="17" type="stmt" count="1"/>
|
||||
<line num="18" type="stmt" count="1"/>
|
||||
<metrics loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="10" coveredelements="8"/>
|
||||
</file>
|
||||
<metrics files="1" loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="10" coveredelements="8"/>
|
||||
</project>
|
||||
</coverage>
|
37
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-crap4j.xml
vendored
Normal file
37
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-crap4j.xml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<crap_result>
|
||||
<project>CoverageForClassWithAnonymousFunction</project>
|
||||
<timestamp>%s</timestamp>
|
||||
<stats>
|
||||
<name>Method Crap Stats</name>
|
||||
<methodCount>2</methodCount>
|
||||
<crapMethodCount>0</crapMethodCount>
|
||||
<crapLoad>0</crapLoad>
|
||||
<totalCrap>2.04</totalCrap>
|
||||
<crapMethodPercent>0</crapMethodPercent>
|
||||
</stats>
|
||||
<methods>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>CoveredClassWithAnonymousFunctionInStaticMethod</className>
|
||||
<methodName>runAnonymous</methodName>
|
||||
<methodSignature>runAnonymous()</methodSignature>
|
||||
<fullMethod>runAnonymous()</fullMethod>
|
||||
<crap>1.04</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>66.67</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>CoveredClassWithAnonymousFunctionInStaticMethod</className>
|
||||
<methodName>anonymous function</methodName>
|
||||
<methodSignature>anonymous function (&$val, $key)</methodSignature>
|
||||
<fullMethod>anonymous function (&$val, $key)</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
</methods>
|
||||
</crap_result>
|
12
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-text.txt
vendored
Normal file
12
vendor/phpunit/php-code-coverage/tests/_files/class-with-anonymous-function-text.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
Code Coverage Report:
|
||||
%s
|
||||
|
||||
Summary:
|
||||
Classes: 0.00% (0/1)
|
||||
Methods: 50.00% (1/2)
|
||||
Lines: 87.50% (7/8)
|
||||
|
||||
CoveredClassWithAnonymousFunctionInStaticMethod
|
||||
Methods: 50.00% ( 1/ 2) Lines: 80.00% ( 4/ 5)
|
17
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml
vendored
Normal file
17
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-clover.xml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<coverage generated="%i">
|
||||
<project timestamp="%i">
|
||||
<file name="%s/source_with_ignore.php">
|
||||
<class name="Foo" namespace="global">
|
||||
<metrics complexity="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
|
||||
</class>
|
||||
<class name="Bar" namespace="global">
|
||||
<metrics complexity="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
|
||||
</class>
|
||||
<line num="2" type="stmt" count="1"/>
|
||||
<line num="6" type="stmt" count="0"/>
|
||||
<metrics loc="37" ncloc="25" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/>
|
||||
</file>
|
||||
<metrics files="1" loc="37" ncloc="25" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="1" elements="2" coveredelements="1"/>
|
||||
</project>
|
||||
</coverage>
|
37
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-crap4j.xml
vendored
Normal file
37
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-crap4j.xml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<crap_result>
|
||||
<project>CoverageForFileWithIgnoredLines</project>
|
||||
<timestamp>%s</timestamp>
|
||||
<stats>
|
||||
<name>Method Crap Stats</name>
|
||||
<methodCount>2</methodCount>
|
||||
<crapMethodCount>0</crapMethodCount>
|
||||
<crapLoad>0</crapLoad>
|
||||
<totalCrap>2</totalCrap>
|
||||
<crapMethodPercent>0</crapMethodPercent>
|
||||
</stats>
|
||||
<methods>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>Foo</className>
|
||||
<methodName>bar</methodName>
|
||||
<methodSignature>bar()</methodSignature>
|
||||
<fullMethod>bar()</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
<method>
|
||||
<package>global</package>
|
||||
<className>Bar</className>
|
||||
<methodName>foo</methodName>
|
||||
<methodSignature>foo()</methodSignature>
|
||||
<fullMethod>foo()</fullMethod>
|
||||
<crap>1</crap>
|
||||
<complexity>1</complexity>
|
||||
<coverage>100</coverage>
|
||||
<crapLoad>0</crapLoad>
|
||||
</method>
|
||||
</methods>
|
||||
</crap_result>
|
10
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-text.txt
vendored
Normal file
10
vendor/phpunit/php-code-coverage/tests/_files/ignored-lines-text.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
Code Coverage Report:%w
|
||||
%s
|
||||
%w
|
||||
Summary:%w
|
||||
Classes: (0/0)
|
||||
Methods: (0/0)
|
||||
Lines: 50.00% (1/2)
|
||||
|
19
vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php
vendored
Normal file
19
vendor/phpunit/php-code-coverage/tests/_files/source_with_class_and_anonymous_function.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class CoveredClassWithAnonymousFunctionInStaticMethod
|
||||
{
|
||||
public static function runAnonymous()
|
||||
{
|
||||
$filter = ['abc124', 'abc123', '123'];
|
||||
|
||||
array_walk(
|
||||
$filter,
|
||||
function (&$val, $key) {
|
||||
$val = preg_replace('|[^0-9]|', '', $val);
|
||||
}
|
||||
);
|
||||
|
||||
// Should be covered
|
||||
$extravar = true;
|
||||
}
|
||||
}
|
37
vendor/phpunit/php-code-coverage/tests/_files/source_with_ignore.php
vendored
Normal file
37
vendor/phpunit/php-code-coverage/tests/_files/source_with_ignore.php
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
if ($neverHappens) {
|
||||
// @codeCoverageIgnoreStart
|
||||
print '*';
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Foo
|
||||
{
|
||||
public function bar()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class Bar
|
||||
{
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
function baz()
|
||||
{
|
||||
print '*'; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
interface Bor
|
||||
{
|
||||
public function foo();
|
||||
|
||||
}
|
20
vendor/phpunit/php-code-coverage/tests/_files/source_with_namespace.php
vendored
Normal file
20
vendor/phpunit/php-code-coverage/tests/_files/source_with_namespace.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace bar\baz;
|
||||
|
||||
/**
|
||||
* Represents foo.
|
||||
*/
|
||||
class source_with_namespace
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $bar
|
||||
*/
|
||||
function &foo($bar)
|
||||
{
|
||||
$baz = function () {};
|
||||
$a = true ? true : false;
|
||||
$b = "{$a}";
|
||||
$c = "${b}";
|
||||
}
|
36
vendor/phpunit/php-code-coverage/tests/_files/source_with_oneline_annotations.php
vendored
Normal file
36
vendor/phpunit/php-code-coverage/tests/_files/source_with_oneline_annotations.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/** Docblock */
|
||||
interface Foo
|
||||
{
|
||||
public function bar();
|
||||
}
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function bar()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
function baz()
|
||||
{
|
||||
// a one-line comment
|
||||
print '*'; // a one-line comment
|
||||
|
||||
/* a one-line comment */
|
||||
print '*'; /* a one-line comment */
|
||||
|
||||
/* a one-line comment
|
||||
*/
|
||||
print '*'; /* a one-line comment
|
||||
*/
|
||||
|
||||
print '*'; // @codeCoverageIgnore
|
||||
|
||||
print '*'; // @codeCoverageIgnoreStart
|
||||
print '*';
|
||||
print '*'; // @codeCoverageIgnoreEnd
|
||||
|
||||
print '*';
|
||||
}
|
4
vendor/phpunit/php-code-coverage/tests/_files/source_without_ignore.php
vendored
Normal file
4
vendor/phpunit/php-code-coverage/tests/_files/source_without_ignore.php
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
if ($neverHappens) {
|
||||
print '*';
|
||||
}
|
18
vendor/phpunit/php-code-coverage/tests/_files/source_without_namespace.php
vendored
Normal file
18
vendor/phpunit/php-code-coverage/tests/_files/source_without_namespace.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Represents foo.
|
||||
*/
|
||||
class Foo
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $bar
|
||||
*/
|
||||
function &foo($bar)
|
||||
{
|
||||
$baz = function () {};
|
||||
$a = true ? true : false;
|
||||
$b = "{$a}";
|
||||
$c = "${b}";
|
||||
}
|
5
vendor/phpunit/php-code-coverage/tests/bootstrap.php
vendored
Normal file
5
vendor/phpunit/php-code-coverage/tests/bootstrap.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require __DIR__ . '/TestCase.php';
|
||||
|
||||
define('TEST_FILES_PATH', __DIR__ . '/_files/');
|
212
vendor/phpunit/php-code-coverage/tests/tests/BuilderTest.php
vendored
Normal file
212
vendor/phpunit/php-code-coverage/tests/tests/BuilderTest.php
vendored
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
use SebastianBergmann\CodeCoverage\Node\Builder;
|
||||
|
||||
class BuilderTest extends TestCase
|
||||
{
|
||||
protected $factory;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->factory = new Builder;
|
||||
}
|
||||
|
||||
public function testSomething()
|
||||
{
|
||||
$root = $this->getCoverageForBankAccount()->getReport();
|
||||
|
||||
$expectedPath = rtrim(TEST_FILES_PATH, DIRECTORY_SEPARATOR);
|
||||
$this->assertEquals($expectedPath, $root->getName());
|
||||
$this->assertEquals($expectedPath, $root->getPath());
|
||||
$this->assertEquals(10, $root->getNumExecutableLines());
|
||||
$this->assertEquals(5, $root->getNumExecutedLines());
|
||||
$this->assertEquals(1, $root->getNumClasses());
|
||||
$this->assertEquals(0, $root->getNumTestedClasses());
|
||||
$this->assertEquals(4, $root->getNumMethods());
|
||||
$this->assertEquals(3, $root->getNumTestedMethods());
|
||||
$this->assertEquals('0.00%', $root->getTestedClassesPercent());
|
||||
$this->assertEquals('75.00%', $root->getTestedMethodsPercent());
|
||||
$this->assertEquals('50.00%', $root->getLineExecutedPercent());
|
||||
$this->assertEquals(0, $root->getNumFunctions());
|
||||
$this->assertEquals(0, $root->getNumTestedFunctions());
|
||||
$this->assertNull($root->getParent());
|
||||
$this->assertEquals([], $root->getDirectories());
|
||||
#$this->assertEquals(array(), $root->getFiles());
|
||||
#$this->assertEquals(array(), $root->getChildNodes());
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'BankAccount' => [
|
||||
'methods' => [
|
||||
'getBalance' => [
|
||||
'signature' => 'getBalance()',
|
||||
'startLine' => 6,
|
||||
'endLine' => 9,
|
||||
'executableLines' => 1,
|
||||
'executedLines' => 1,
|
||||
'ccn' => 1,
|
||||
'coverage' => 100,
|
||||
'crap' => '1',
|
||||
'link' => 'BankAccount.php.html#6',
|
||||
'methodName' => 'getBalance',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
'setBalance' => [
|
||||
'signature' => 'setBalance($balance)',
|
||||
'startLine' => 11,
|
||||
'endLine' => 18,
|
||||
'executableLines' => 5,
|
||||
'executedLines' => 0,
|
||||
'ccn' => 2,
|
||||
'coverage' => 0,
|
||||
'crap' => 6,
|
||||
'link' => 'BankAccount.php.html#11',
|
||||
'methodName' => 'setBalance',
|
||||
'visibility' => 'protected',
|
||||
],
|
||||
'depositMoney' => [
|
||||
'signature' => 'depositMoney($balance)',
|
||||
'startLine' => 20,
|
||||
'endLine' => 25,
|
||||
'executableLines' => 2,
|
||||
'executedLines' => 2,
|
||||
'ccn' => 1,
|
||||
'coverage' => 100,
|
||||
'crap' => '1',
|
||||
'link' => 'BankAccount.php.html#20',
|
||||
'methodName' => 'depositMoney',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
'withdrawMoney' => [
|
||||
'signature' => 'withdrawMoney($balance)',
|
||||
'startLine' => 27,
|
||||
'endLine' => 32,
|
||||
'executableLines' => 2,
|
||||
'executedLines' => 2,
|
||||
'ccn' => 1,
|
||||
'coverage' => 100,
|
||||
'crap' => '1',
|
||||
'link' => 'BankAccount.php.html#27',
|
||||
'methodName' => 'withdrawMoney',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
],
|
||||
'startLine' => 2,
|
||||
'executableLines' => 10,
|
||||
'executedLines' => 5,
|
||||
'ccn' => 5,
|
||||
'coverage' => 50,
|
||||
'crap' => '8.12',
|
||||
'package' => [
|
||||
'namespace' => '',
|
||||
'fullPackage' => '',
|
||||
'category' => '',
|
||||
'package' => '',
|
||||
'subpackage' => ''
|
||||
],
|
||||
'link' => 'BankAccount.php.html#2',
|
||||
'className' => 'BankAccount'
|
||||
]
|
||||
],
|
||||
$root->getClasses()
|
||||
);
|
||||
|
||||
$this->assertEquals([], $root->getFunctions());
|
||||
}
|
||||
|
||||
public function testBuildDirectoryStructure()
|
||||
{
|
||||
$method = new \ReflectionMethod(
|
||||
Builder::class,
|
||||
'buildDirectoryStructure'
|
||||
);
|
||||
|
||||
$method->setAccessible(true);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'src' => [
|
||||
'Money.php/f' => [],
|
||||
'MoneyBag.php/f' => []
|
||||
]
|
||||
],
|
||||
$method->invoke(
|
||||
$this->factory,
|
||||
['src/Money.php' => [], 'src/MoneyBag.php' => []]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider reducePathsProvider
|
||||
*/
|
||||
public function testReducePaths($reducedPaths, $commonPath, $paths)
|
||||
{
|
||||
$method = new \ReflectionMethod(
|
||||
Builder::class,
|
||||
'reducePaths'
|
||||
);
|
||||
|
||||
$method->setAccessible(true);
|
||||
|
||||
$_commonPath = $method->invokeArgs($this->factory, [&$paths]);
|
||||
|
||||
$this->assertEquals($reducedPaths, $paths);
|
||||
$this->assertEquals($commonPath, $_commonPath);
|
||||
}
|
||||
|
||||
public function reducePathsProvider()
|
||||
{
|
||||
return [
|
||||
[
|
||||
[
|
||||
'Money.php' => [],
|
||||
'MoneyBag.php' => []
|
||||
],
|
||||
'/home/sb/Money',
|
||||
[
|
||||
'/home/sb/Money/Money.php' => [],
|
||||
'/home/sb/Money/MoneyBag.php' => []
|
||||
]
|
||||
],
|
||||
[
|
||||
[
|
||||
'Money.php' => []
|
||||
],
|
||||
'/home/sb/Money/',
|
||||
[
|
||||
'/home/sb/Money/Money.php' => []
|
||||
]
|
||||
],
|
||||
[
|
||||
[],
|
||||
'.',
|
||||
[]
|
||||
],
|
||||
[
|
||||
[
|
||||
'Money.php' => [],
|
||||
'MoneyBag.php' => [],
|
||||
'Cash.phar/Cash.php' => [],
|
||||
],
|
||||
'/home/sb/Money',
|
||||
[
|
||||
'/home/sb/Money/Money.php' => [],
|
||||
'/home/sb/Money/MoneyBag.php' => [],
|
||||
'phar:///home/sb/Money/Cash.phar/Cash.php' => [],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
49
vendor/phpunit/php-code-coverage/tests/tests/CloverTest.php
vendored
Normal file
49
vendor/phpunit/php-code-coverage/tests/tests/CloverTest.php
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Report\Clover
|
||||
*/
|
||||
class CloverTest extends TestCase
|
||||
{
|
||||
public function testCloverForBankAccountTest()
|
||||
{
|
||||
$clover = new Clover;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'BankAccount-clover.xml',
|
||||
$clover->process($this->getCoverageForBankAccount(), null, 'BankAccount')
|
||||
);
|
||||
}
|
||||
|
||||
public function testCloverForFileWithIgnoredLines()
|
||||
{
|
||||
$clover = new Clover;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'ignored-lines-clover.xml',
|
||||
$clover->process($this->getCoverageForFileWithIgnoredLines())
|
||||
);
|
||||
}
|
||||
|
||||
public function testCloverForClassWithAnonymousFunction()
|
||||
{
|
||||
$clover = new Clover;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml',
|
||||
$clover->process($this->getCoverageForClassWithAnonymousFunction())
|
||||
);
|
||||
}
|
||||
}
|
547
vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php
vendored
Normal file
547
vendor/phpunit/php-code-coverage/tests/tests/CodeCoverageTest.php
vendored
Normal file
@ -0,0 +1,547 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\Driver\PHPDBG;
|
||||
use SebastianBergmann\CodeCoverage\Driver\Xdebug;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\CodeCoverage
|
||||
*/
|
||||
class CodeCoverageTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var CodeCoverage
|
||||
*/
|
||||
private $coverage;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->coverage = new CodeCoverage;
|
||||
}
|
||||
|
||||
public function testCanBeConstructedForXdebugWithoutGivenFilterObject()
|
||||
{
|
||||
if (PHP_SAPI == 'phpdbg') {
|
||||
$this->markTestSkipped('Requires PHP CLI and Xdebug');
|
||||
}
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
Xdebug::class,
|
||||
'driver',
|
||||
$this->coverage
|
||||
);
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
Filter::class,
|
||||
'filter',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
public function testCanBeConstructedForXdebugWithGivenFilterObject()
|
||||
{
|
||||
if (PHP_SAPI == 'phpdbg') {
|
||||
$this->markTestSkipped('Requires PHP CLI and Xdebug');
|
||||
}
|
||||
|
||||
$filter = new Filter;
|
||||
$coverage = new CodeCoverage(null, $filter);
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
Xdebug::class,
|
||||
'driver',
|
||||
$coverage
|
||||
);
|
||||
|
||||
$this->assertSame($filter, $coverage->filter());
|
||||
}
|
||||
|
||||
public function testCanBeConstructedForPhpdbgWithoutGivenFilterObject()
|
||||
{
|
||||
if (PHP_SAPI != 'phpdbg') {
|
||||
$this->markTestSkipped('Requires PHPDBG');
|
||||
}
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
PHPDBG::class,
|
||||
'driver',
|
||||
$this->coverage
|
||||
);
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
Filter::class,
|
||||
'filter',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
public function testCanBeConstructedForPhpdbgWithGivenFilterObject()
|
||||
{
|
||||
if (PHP_SAPI != 'phpdbg') {
|
||||
$this->markTestSkipped('Requires PHPDBG');
|
||||
}
|
||||
|
||||
$filter = new Filter;
|
||||
$coverage = new CodeCoverage(null, $filter);
|
||||
|
||||
$this->assertAttributeInstanceOf(
|
||||
PHPDBG::class,
|
||||
'driver',
|
||||
$coverage
|
||||
);
|
||||
|
||||
$this->assertSame($filter, $coverage->filter());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testCannotStartWithInvalidArgument()
|
||||
{
|
||||
$this->coverage->start(null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testCannotStopWithInvalidFirstArgument()
|
||||
{
|
||||
$this->coverage->stop(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testCannotStopWithInvalidSecondArgument()
|
||||
{
|
||||
$this->coverage->stop(true, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testCannotAppendWithInvalidArgument()
|
||||
{
|
||||
$this->coverage->append([], null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetCacheTokensThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setCacheTokens(null);
|
||||
}
|
||||
|
||||
public function testSetCacheTokens()
|
||||
{
|
||||
$this->coverage->setCacheTokens(true);
|
||||
$this->assertAttributeEquals(true, 'cacheTokens', $this->coverage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetCheckForUnintentionallyCoveredCodeThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setCheckForUnintentionallyCoveredCode(null);
|
||||
}
|
||||
|
||||
public function testSetCheckForUnintentionallyCoveredCode()
|
||||
{
|
||||
$this->coverage->setCheckForUnintentionallyCoveredCode(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'checkForUnintentionallyCoveredCode',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetForceCoversAnnotationThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setForceCoversAnnotation(null);
|
||||
}
|
||||
|
||||
public function testSetCheckForMissingCoversAnnotation()
|
||||
{
|
||||
$this->coverage->setCheckForMissingCoversAnnotation(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'checkForMissingCoversAnnotation',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetCheckForMissingCoversAnnotationThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setCheckForMissingCoversAnnotation(null);
|
||||
}
|
||||
|
||||
public function testSetForceCoversAnnotation()
|
||||
{
|
||||
$this->coverage->setForceCoversAnnotation(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'forceCoversAnnotation',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetCheckForUnexecutedCoveredCodeThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setCheckForUnexecutedCoveredCode(null);
|
||||
}
|
||||
|
||||
public function testSetCheckForUnexecutedCoveredCode()
|
||||
{
|
||||
$this->coverage->setCheckForUnexecutedCoveredCode(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'checkForUnexecutedCoveredCode',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetAddUncoveredFilesFromWhitelistThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setAddUncoveredFilesFromWhitelist(null);
|
||||
}
|
||||
|
||||
public function testSetAddUncoveredFilesFromWhitelist()
|
||||
{
|
||||
$this->coverage->setAddUncoveredFilesFromWhitelist(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'addUncoveredFilesFromWhitelist',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetProcessUncoveredFilesFromWhitelistThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setProcessUncoveredFilesFromWhitelist(null);
|
||||
}
|
||||
|
||||
public function testSetProcessUncoveredFilesFromWhitelist()
|
||||
{
|
||||
$this->coverage->setProcessUncoveredFilesFromWhitelist(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'processUncoveredFilesFromWhitelist',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
public function testSetIgnoreDeprecatedCode()
|
||||
{
|
||||
$this->coverage->setIgnoreDeprecatedCode(true);
|
||||
$this->assertAttributeEquals(
|
||||
true,
|
||||
'ignoreDeprecatedCode',
|
||||
$this->coverage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\Exception
|
||||
*/
|
||||
public function testSetIgnoreDeprecatedCodeThrowsExceptionForInvalidArgument()
|
||||
{
|
||||
$this->coverage->setIgnoreDeprecatedCode(null);
|
||||
}
|
||||
|
||||
public function testClear()
|
||||
{
|
||||
$this->coverage->clear();
|
||||
|
||||
$this->assertAttributeEquals(null, 'currentId', $this->coverage);
|
||||
$this->assertAttributeEquals([], 'data', $this->coverage);
|
||||
$this->assertAttributeEquals([], 'tests', $this->coverage);
|
||||
}
|
||||
|
||||
public function testCollect()
|
||||
{
|
||||
$coverage = $this->getCoverageForBankAccount();
|
||||
|
||||
$this->assertEquals(
|
||||
$this->getExpectedDataArrayForBankAccount(),
|
||||
$coverage->getData()
|
||||
);
|
||||
|
||||
if (version_compare(\PHPUnit_Runner_Version::id(), '4.7', '>=')) {
|
||||
$size = 'unknown';
|
||||
} else {
|
||||
$size = 'small';
|
||||
}
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'BankAccountTest::testBalanceIsInitiallyZero' => ['size' => $size, 'status' => null],
|
||||
'BankAccountTest::testBalanceCannotBecomeNegative' => ['size' => $size, 'status' => null],
|
||||
'BankAccountTest::testBalanceCannotBecomeNegative2' => ['size' => $size, 'status' => null],
|
||||
'BankAccountTest::testDepositWithdrawMoney' => ['size' => $size, 'status' => null]
|
||||
],
|
||||
$coverage->getTests()
|
||||
);
|
||||
}
|
||||
|
||||
public function testMerge()
|
||||
{
|
||||
$coverage = $this->getCoverageForBankAccountForFirstTwoTests();
|
||||
$coverage->merge($this->getCoverageForBankAccountForLastTwoTests());
|
||||
|
||||
$this->assertEquals(
|
||||
$this->getExpectedDataArrayForBankAccount(),
|
||||
$coverage->getData()
|
||||
);
|
||||
}
|
||||
|
||||
public function testMerge2()
|
||||
{
|
||||
$coverage = new CodeCoverage(
|
||||
$this->createMock(Xdebug::class),
|
||||
new Filter
|
||||
);
|
||||
|
||||
$coverage->merge($this->getCoverageForBankAccount());
|
||||
|
||||
$this->assertEquals(
|
||||
$this->getExpectedDataArrayForBankAccount(),
|
||||
$coverage->getData()
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetLinesToBeIgnored()
|
||||
{
|
||||
$this->assertEquals(
|
||||
[
|
||||
1,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38
|
||||
],
|
||||
$this->getLinesToBeIgnored()->invoke(
|
||||
$this->coverage,
|
||||
TEST_FILES_PATH . 'source_with_ignore.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetLinesToBeIgnored2()
|
||||
{
|
||||
$this->assertEquals(
|
||||
[1, 5],
|
||||
$this->getLinesToBeIgnored()->invoke(
|
||||
$this->coverage,
|
||||
TEST_FILES_PATH . 'source_without_ignore.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetLinesToBeIgnored3()
|
||||
{
|
||||
$this->assertEquals(
|
||||
[
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
11,
|
||||
15,
|
||||
16,
|
||||
19,
|
||||
20
|
||||
],
|
||||
$this->getLinesToBeIgnored()->invoke(
|
||||
$this->coverage,
|
||||
TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetLinesToBeIgnoredOneLineAnnotations()
|
||||
{
|
||||
$this->assertEquals(
|
||||
[
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
18,
|
||||
20,
|
||||
21,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
37
|
||||
],
|
||||
$this->getLinesToBeIgnored()->invoke(
|
||||
$this->coverage,
|
||||
TEST_FILES_PATH . 'source_with_oneline_annotations.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ReflectionMethod
|
||||
*/
|
||||
private function getLinesToBeIgnored()
|
||||
{
|
||||
$getLinesToBeIgnored = new \ReflectionMethod(
|
||||
'SebastianBergmann\CodeCoverage\CodeCoverage',
|
||||
'getLinesToBeIgnored'
|
||||
);
|
||||
|
||||
$getLinesToBeIgnored->setAccessible(true);
|
||||
|
||||
return $getLinesToBeIgnored;
|
||||
}
|
||||
|
||||
public function testGetLinesToBeIgnoredWhenIgnoreIsDisabled()
|
||||
{
|
||||
$this->coverage->setDisableIgnoredLines(true);
|
||||
|
||||
$this->assertEquals(
|
||||
[],
|
||||
$this->getLinesToBeIgnored()->invoke(
|
||||
$this->coverage,
|
||||
TEST_FILES_PATH . 'source_with_ignore.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException
|
||||
*/
|
||||
public function testAppendThrowsExceptionIfCoveredCodeWasNotExecuted()
|
||||
{
|
||||
$this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH);
|
||||
$this->coverage->setCheckForUnexecutedCoveredCode(true);
|
||||
|
||||
$data = [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
29 => -1,
|
||||
31 => -1
|
||||
]
|
||||
];
|
||||
|
||||
$linesToBeCovered = [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
22,
|
||||
24
|
||||
]
|
||||
];
|
||||
|
||||
$linesToBeUsed = [];
|
||||
|
||||
$this->coverage->append($data, 'File1.php', true, $linesToBeCovered, $linesToBeUsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException
|
||||
*/
|
||||
public function testAppendThrowsExceptionIfUsedCodeWasNotExecuted()
|
||||
{
|
||||
$this->coverage->filter()->addDirectoryToWhitelist(TEST_FILES_PATH);
|
||||
$this->coverage->setCheckForUnexecutedCoveredCode(true);
|
||||
|
||||
$data = [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
29 => -1,
|
||||
31 => -1
|
||||
]
|
||||
];
|
||||
|
||||
$linesToBeCovered = [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
29,
|
||||
31
|
||||
]
|
||||
];
|
||||
|
||||
$linesToBeUsed = [
|
||||
TEST_FILES_PATH . 'BankAccount.php' => [
|
||||
22,
|
||||
24
|
||||
]
|
||||
];
|
||||
|
||||
$this->coverage->append($data, 'File1.php', true, $linesToBeCovered, $linesToBeUsed);
|
||||
}
|
||||
}
|
49
vendor/phpunit/php-code-coverage/tests/tests/Crap4jTest.php
vendored
Normal file
49
vendor/phpunit/php-code-coverage/tests/tests/Crap4jTest.php
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Report\Crap4j
|
||||
*/
|
||||
class Crap4jTest extends TestCase
|
||||
{
|
||||
public function testForBankAccountTest()
|
||||
{
|
||||
$crap4j = new Crap4j;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'BankAccount-crap4j.xml',
|
||||
$crap4j->process($this->getCoverageForBankAccount(), null, 'BankAccount')
|
||||
);
|
||||
}
|
||||
|
||||
public function testForFileWithIgnoredLines()
|
||||
{
|
||||
$crap4j = new Crap4j;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'ignored-lines-crap4j.xml',
|
||||
$crap4j->process($this->getCoverageForFileWithIgnoredLines(), null, 'CoverageForFileWithIgnoredLines')
|
||||
);
|
||||
}
|
||||
|
||||
public function testForClassWithAnonymousFunction()
|
||||
{
|
||||
$crap4j = new Crap4j;
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'class-with-anonymous-function-crap4j.xml',
|
||||
$crap4j->process($this->getCoverageForClassWithAnonymousFunction(), null, 'CoverageForClassWithAnonymousFunction')
|
||||
);
|
||||
}
|
||||
}
|
194
vendor/phpunit/php-code-coverage/tests/tests/FilterTest.php
vendored
Normal file
194
vendor/phpunit/php-code-coverage/tests/tests/FilterTest.php
vendored
Normal file
@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage;
|
||||
|
||||
class FilterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var Filter
|
||||
*/
|
||||
private $filter;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $files = [];
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->filter = unserialize('O:37:"SebastianBergmann\CodeCoverage\Filter":0:{}');
|
||||
|
||||
$this->files = [
|
||||
TEST_FILES_PATH . 'BankAccount.php',
|
||||
TEST_FILES_PATH . 'BankAccountTest.php',
|
||||
TEST_FILES_PATH . 'CoverageClassExtendedTest.php',
|
||||
TEST_FILES_PATH . 'CoverageClassTest.php',
|
||||
TEST_FILES_PATH . 'CoverageFunctionParenthesesTest.php',
|
||||
TEST_FILES_PATH . 'CoverageFunctionParenthesesWhitespaceTest.php',
|
||||
TEST_FILES_PATH . 'CoverageFunctionTest.php',
|
||||
TEST_FILES_PATH . 'CoverageMethodOneLineAnnotationTest.php',
|
||||
TEST_FILES_PATH . 'CoverageMethodParenthesesTest.php',
|
||||
TEST_FILES_PATH . 'CoverageMethodParenthesesWhitespaceTest.php',
|
||||
TEST_FILES_PATH . 'CoverageMethodTest.php',
|
||||
TEST_FILES_PATH . 'CoverageNoneTest.php',
|
||||
TEST_FILES_PATH . 'CoverageNotPrivateTest.php',
|
||||
TEST_FILES_PATH . 'CoverageNotProtectedTest.php',
|
||||
TEST_FILES_PATH . 'CoverageNotPublicTest.php',
|
||||
TEST_FILES_PATH . 'CoverageNothingTest.php',
|
||||
TEST_FILES_PATH . 'CoveragePrivateTest.php',
|
||||
TEST_FILES_PATH . 'CoverageProtectedTest.php',
|
||||
TEST_FILES_PATH . 'CoveragePublicTest.php',
|
||||
TEST_FILES_PATH . 'CoverageTwoDefaultClassAnnotations.php',
|
||||
TEST_FILES_PATH . 'CoveredClass.php',
|
||||
TEST_FILES_PATH . 'CoveredFunction.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageClassExtendedTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageClassTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageCoversClassPublicTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageCoversClassTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageMethodTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageNotPrivateTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageNotProtectedTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageNotPublicTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoveragePrivateTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoverageProtectedTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoveragePublicTest.php',
|
||||
TEST_FILES_PATH . 'NamespaceCoveredClass.php',
|
||||
TEST_FILES_PATH . 'NotExistingCoveredElementTest.php',
|
||||
TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php',
|
||||
TEST_FILES_PATH . 'source_with_ignore.php',
|
||||
TEST_FILES_PATH . 'source_with_namespace.php',
|
||||
TEST_FILES_PATH . 'source_with_oneline_annotations.php',
|
||||
TEST_FILES_PATH . 'source_without_ignore.php',
|
||||
TEST_FILES_PATH . 'source_without_namespace.php'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::addFileToWhitelist
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
|
||||
*/
|
||||
public function testAddingAFileToTheWhitelistWorks()
|
||||
{
|
||||
$this->filter->addFileToWhitelist($this->files[0]);
|
||||
|
||||
$this->assertEquals(
|
||||
[$this->files[0]],
|
||||
$this->filter->getWhitelist()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::removeFileFromWhitelist
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
|
||||
*/
|
||||
public function testRemovingAFileFromTheWhitelistWorks()
|
||||
{
|
||||
$this->filter->addFileToWhitelist($this->files[0]);
|
||||
$this->filter->removeFileFromWhitelist($this->files[0]);
|
||||
|
||||
$this->assertEquals([], $this->filter->getWhitelist());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::addDirectoryToWhitelist
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
|
||||
* @depends testAddingAFileToTheWhitelistWorks
|
||||
*/
|
||||
public function testAddingADirectoryToTheWhitelistWorks()
|
||||
{
|
||||
$this->filter->addDirectoryToWhitelist(TEST_FILES_PATH);
|
||||
|
||||
$whitelist = $this->filter->getWhitelist();
|
||||
sort($whitelist);
|
||||
|
||||
$this->assertEquals($this->files, $whitelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::addFilesToWhitelist
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
|
||||
*/
|
||||
public function testAddingFilesToTheWhitelistWorks()
|
||||
{
|
||||
$facade = new \File_Iterator_Facade;
|
||||
|
||||
$files = $facade->getFilesAsArray(
|
||||
TEST_FILES_PATH,
|
||||
$suffixes = '.php'
|
||||
);
|
||||
|
||||
$this->filter->addFilesToWhitelist($files);
|
||||
|
||||
$whitelist = $this->filter->getWhitelist();
|
||||
sort($whitelist);
|
||||
|
||||
$this->assertEquals($this->files, $whitelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::removeDirectoryFromWhitelist
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::getWhitelist
|
||||
* @depends testAddingADirectoryToTheWhitelistWorks
|
||||
*/
|
||||
public function testRemovingADirectoryFromTheWhitelistWorks()
|
||||
{
|
||||
$this->filter->addDirectoryToWhitelist(TEST_FILES_PATH);
|
||||
$this->filter->removeDirectoryFromWhitelist(TEST_FILES_PATH);
|
||||
|
||||
$this->assertEquals([], $this->filter->getWhitelist());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::isFile
|
||||
*/
|
||||
public function testIsFile()
|
||||
{
|
||||
$this->assertFalse($this->filter->isFile('vfs://root/a/path'));
|
||||
$this->assertFalse($this->filter->isFile('xdebug://debug-eval'));
|
||||
$this->assertFalse($this->filter->isFile('eval()\'d code'));
|
||||
$this->assertFalse($this->filter->isFile('runtime-created function'));
|
||||
$this->assertFalse($this->filter->isFile('assert code'));
|
||||
$this->assertFalse($this->filter->isFile('regexp code'));
|
||||
$this->assertTrue($this->filter->isFile(__FILE__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::isFiltered
|
||||
*/
|
||||
public function testWhitelistedFileIsNotFiltered()
|
||||
{
|
||||
$this->filter->addFileToWhitelist($this->files[0]);
|
||||
$this->assertFalse($this->filter->isFiltered($this->files[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::isFiltered
|
||||
*/
|
||||
public function testNotWhitelistedFileIsFiltered()
|
||||
{
|
||||
$this->filter->addFileToWhitelist($this->files[0]);
|
||||
$this->assertTrue($this->filter->isFiltered($this->files[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::isFiltered
|
||||
* @covers SebastianBergmann\CodeCoverage\Filter::isFile
|
||||
*/
|
||||
public function testNonFilesAreFiltered()
|
||||
{
|
||||
$this->assertTrue($this->filter->isFiltered('vfs://root/a/path'));
|
||||
$this->assertTrue($this->filter->isFiltered('xdebug://debug-eval'));
|
||||
$this->assertTrue($this->filter->isFiltered('eval()\'d code'));
|
||||
$this->assertTrue($this->filter->isFiltered('runtime-created function'));
|
||||
$this->assertTrue($this->filter->isFiltered('assert code'));
|
||||
$this->assertTrue($this->filter->isFiltered('regexp code'));
|
||||
}
|
||||
}
|
103
vendor/phpunit/php-code-coverage/tests/tests/HTMLTest.php
vendored
Normal file
103
vendor/phpunit/php-code-coverage/tests/tests/HTMLTest.php
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report\Html;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
|
||||
class HTMLTest extends TestCase
|
||||
{
|
||||
private static $TEST_REPORT_PATH_SOURCE;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'HTML';
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
$tmpFilesIterator = new \RecursiveIteratorIterator(
|
||||
new \RecursiveDirectoryIterator(self::$TEST_TMP_PATH, \RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
\RecursiveIteratorIterator::CHILD_FIRST
|
||||
);
|
||||
|
||||
foreach ($tmpFilesIterator as $path => $fileInfo) {
|
||||
/* @var \SplFileInfo $fileInfo */
|
||||
$pathname = $fileInfo->getPathname();
|
||||
$fileInfo->isDir() ? rmdir($pathname) : unlink($pathname);
|
||||
}
|
||||
}
|
||||
|
||||
public function testForBankAccountTest()
|
||||
{
|
||||
$expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForBankAccount';
|
||||
|
||||
$report = new Facade;
|
||||
$report->process($this->getCoverageForBankAccount(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
public function testForFileWithIgnoredLines()
|
||||
{
|
||||
$expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines';
|
||||
|
||||
$report = new Facade;
|
||||
$report->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
public function testForClassWithAnonymousFunction()
|
||||
{
|
||||
$expectedFilesPath =
|
||||
self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction';
|
||||
|
||||
$report = new Facade;
|
||||
$report->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expectedFilesPath
|
||||
* @param string $actualFilesPath
|
||||
*/
|
||||
private function assertFilesEquals($expectedFilesPath, $actualFilesPath)
|
||||
{
|
||||
$expectedFilesIterator = new \FilesystemIterator($expectedFilesPath);
|
||||
$actualFilesIterator = new \RegexIterator(new \FilesystemIterator($actualFilesPath), '/.html/');
|
||||
|
||||
$this->assertEquals(
|
||||
iterator_count($expectedFilesIterator),
|
||||
iterator_count($actualFilesIterator),
|
||||
'Generated files and expected files not match'
|
||||
);
|
||||
|
||||
foreach ($expectedFilesIterator as $path => $fileInfo) {
|
||||
/* @var \SplFileInfo $fileInfo */
|
||||
$filename = $fileInfo->getFilename();
|
||||
|
||||
$actualFile = $actualFilesPath . DIRECTORY_SEPARATOR . $filename;
|
||||
|
||||
$this->assertFileExists($actualFile);
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
$fileInfo->getPathname(),
|
||||
str_replace(PHP_EOL, "\n", file_get_contents($actualFile)),
|
||||
"${filename} not match"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
49
vendor/phpunit/php-code-coverage/tests/tests/TextTest.php
vendored
Normal file
49
vendor/phpunit/php-code-coverage/tests/tests/TextTest.php
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Report\Text
|
||||
*/
|
||||
class TextTest extends TestCase
|
||||
{
|
||||
public function testTextForBankAccountTest()
|
||||
{
|
||||
$text = new Text(50, 90, false, false);
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'BankAccount-text.txt',
|
||||
str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForBankAccount()))
|
||||
);
|
||||
}
|
||||
|
||||
public function testTextForFileWithIgnoredLines()
|
||||
{
|
||||
$text = new Text(50, 90, false, false);
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'ignored-lines-text.txt',
|
||||
str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForFileWithIgnoredLines()))
|
||||
);
|
||||
}
|
||||
|
||||
public function testTextForClassWithAnonymousFunction()
|
||||
{
|
||||
$text = new Text(50, 90, false, false);
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
TEST_FILES_PATH . 'class-with-anonymous-function-text.txt',
|
||||
str_replace(PHP_EOL, "\n", $text->process($this->getCoverageForClassWithAnonymousFunction()))
|
||||
);
|
||||
}
|
||||
}
|
27
vendor/phpunit/php-code-coverage/tests/tests/UtilTest.php
vendored
Normal file
27
vendor/phpunit/php-code-coverage/tests/tests/UtilTest.php
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\CodeCoverage\Util
|
||||
*/
|
||||
class UtilTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testPercent()
|
||||
{
|
||||
$this->assertEquals(100, Util::percent(100, 0));
|
||||
$this->assertEquals(100, Util::percent(100, 100));
|
||||
$this->assertEquals(
|
||||
'100.00%',
|
||||
Util::percent(100, 100, true)
|
||||
);
|
||||
}
|
||||
}
|
99
vendor/phpunit/php-code-coverage/tests/tests/XMLTest.php
vendored
Normal file
99
vendor/phpunit/php-code-coverage/tests/tests/XMLTest.php
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the php-code-coverage package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\CodeCoverage\Report\Xml;
|
||||
|
||||
use SebastianBergmann\CodeCoverage\TestCase;
|
||||
|
||||
class XMLTest extends TestCase
|
||||
{
|
||||
private static $TEST_REPORT_PATH_SOURCE;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
self::$TEST_REPORT_PATH_SOURCE = TEST_FILES_PATH . 'Report' . DIRECTORY_SEPARATOR . 'XML';
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
parent::tearDown();
|
||||
|
||||
$tmpFilesIterator = new \FilesystemIterator(self::$TEST_TMP_PATH);
|
||||
|
||||
foreach ($tmpFilesIterator as $path => $fileInfo) {
|
||||
/* @var \SplFileInfo $fileInfo */
|
||||
unlink($fileInfo->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
public function testForBankAccountTest()
|
||||
{
|
||||
$expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForBankAccount';
|
||||
|
||||
$xml = new Facade;
|
||||
$xml->process($this->getCoverageForBankAccount(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
public function testForFileWithIgnoredLines()
|
||||
{
|
||||
$expectedFilesPath = self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForFileWithIgnoredLines';
|
||||
|
||||
$xml = new Facade;
|
||||
$xml->process($this->getCoverageForFileWithIgnoredLines(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
public function testForClassWithAnonymousFunction()
|
||||
{
|
||||
$expectedFilesPath =
|
||||
self::$TEST_REPORT_PATH_SOURCE . DIRECTORY_SEPARATOR . 'CoverageForClassWithAnonymousFunction';
|
||||
|
||||
$xml = new Facade;
|
||||
$xml->process($this->getCoverageForClassWithAnonymousFunction(), self::$TEST_TMP_PATH);
|
||||
|
||||
$this->assertFilesEquals($expectedFilesPath, self::$TEST_TMP_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expectedFilesPath
|
||||
* @param string $actualFilesPath
|
||||
*/
|
||||
private function assertFilesEquals($expectedFilesPath, $actualFilesPath)
|
||||
{
|
||||
$expectedFilesIterator = new \FilesystemIterator($expectedFilesPath);
|
||||
$actualFilesIterator = new \FilesystemIterator($actualFilesPath);
|
||||
|
||||
$this->assertEquals(
|
||||
iterator_count($expectedFilesIterator),
|
||||
iterator_count($actualFilesIterator),
|
||||
'Generated files and expected files not match'
|
||||
);
|
||||
|
||||
foreach ($expectedFilesIterator as $path => $fileInfo) {
|
||||
/* @var \SplFileInfo $fileInfo */
|
||||
$filename = $fileInfo->getFilename();
|
||||
|
||||
$actualFile = $actualFilesPath . DIRECTORY_SEPARATOR . $filename;
|
||||
|
||||
$this->assertFileExists($actualFile);
|
||||
|
||||
$this->assertStringMatchesFormatFile(
|
||||
$fileInfo->getPathname(),
|
||||
file_get_contents($actualFile),
|
||||
"${filename} not match"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user