Skip to content

Commit 613e70f

Browse files
Slamdunksebastianbergmann
authored andcommitted
Add test
1 parent afeddca commit 613e70f

File tree

4 files changed

+110
-0
lines changed

4 files changed

+110
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
final class NoLogNoCc
12+
{
13+
public function getTrue(): bool
14+
{
15+
return true;
16+
}
17+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
use PHPUnit\Framework\TestCase;
11+
12+
/**
13+
* @covers NoLogNoCc
14+
*/
15+
final class NoLogNoCcTest extends TestCase
16+
{
17+
public function testSuccess(): void
18+
{
19+
$this->assertTrue((new NoLogNoCc())->getTrue());
20+
}
21+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="../../../../phpunit.xsd"
4+
verbose="false"
5+
colors="false"
6+
cacheResult="false">
7+
<coverage>
8+
<report>
9+
<clover outputFile="php://stdout"/>
10+
<crap4j outputFile="php://stdout" threshold="50"/>
11+
<!-- <html outputDirectory="html-coverage" lowUpperBound="50" highLowerBound="90"/> -->
12+
<php outputFile="php://stdout"/>
13+
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="false"/>
14+
<!-- <xml outputDirectory="xml-coverage"/> -->
15+
</report>
16+
</coverage>
17+
18+
<logging>
19+
<junit outputFile="php://stdout"/>
20+
<teamcity outputFile="php://stdout"/>
21+
<testdoxHtml outputFile="php://stdout"/>
22+
<testdoxText outputFile="php://stdout"/>
23+
<testdoxXml outputFile="php://stdout"/>
24+
<text outputFile="php://stdout"/>
25+
</logging>
26+
</phpunit>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
--TEST--
2+
phpunit -c _files/phpunit.xml --no-logging --log-junit php://stdout --no-coverage --coverage-filter _files/NoLogNoCc.php --coverage-text _files/NoLogNoCcTest.php
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$arguments = [
6+
'--configuration',
7+
\realpath(__DIR__ . '/_files/phpunit.xml'),
8+
'--no-logging',
9+
'--log-junit',
10+
'php://stdout',
11+
'--no-coverage',
12+
'--coverage-filter',
13+
\realpath(__DIR__ . '/_files/NoLogNoCc.php'),
14+
'--coverage-text',
15+
\realpath(__DIR__ . '/_files/NoLogNoCcTest.php'),
16+
];
17+
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
18+
19+
require __DIR__ . '/../../bootstrap.php';
20+
PHPUnit\TextUI\Command::main();
21+
--EXPECTF--
22+
PHPUnit %s by Sebastian Bergmann and contributors.
23+
24+
. 1 / 1 (100%)<?xml version="1.0" encoding="UTF-8"?>
25+
<testsuites>
26+
<testsuite name="NoLogNoCcTest" file="%sNoLogNoCcTest.php" tests="1" assertions="1" errors="0" warnings="0" failures="0" skipped="0" time="%f">
27+
<testcase name="testSuccess" class="NoLogNoCcTest" classname="NoLogNoCcTest" file="%sNoLogNoCcTest.php" line="17" assertions="1" time="%f"/>
28+
</testsuite>
29+
</testsuites>
30+
31+
32+
Time: %s, Memory: %s
33+
34+
OK (1 test, 1 assertion)
35+
36+
37+
Code Coverage Report:
38+
%s
39+
40+
Summary:
41+
Classes: 100.00% (1/1)
42+
Methods: 100.00% (1/1)
43+
Lines: 100.00% (1/1)
44+
45+
NoLogNoCc
46+
Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 1/ 1)

0 commit comments

Comments
 (0)