Skip to content

Commit e82997a

Browse files
committed
move test into end-to-end/phar/tests/code-coverage
1 parent c3647a0 commit e82997a

File tree

5 files changed

+69
-7
lines changed

5 files changed

+69
-7
lines changed

tests/end-to-end/phar/phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<testsuites>
88
<testsuite name="default">
99
<directory>tests/standard</directory>
10+
<directory>tests/code-coverage</directory>
1011
<directory suffix="phpt">tests/phpt</directory>
1112
</testsuite>
1213
</testsuites>

tests/end-to-end/code-coverage/warn-when-opcache-enabled.phpt renamed to tests/end-to-end/phar/tests/code-coverage/warn-when-opcache-enabled.phpt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ https://github.com/sebastianbergmann/php-code-coverage/issues/1022
33
--INI--
44
opcache.enable_cli=1
55
opcache.jit=disable
6+
pcov.directory=tests/end-to-end/phar/tests/code-coverage/warn-when-opcache-enabled/src/
67
--SKIPIF--
78
<?php declare(strict_types=1);
89
require __DIR__ . '/../../_files/skip-if-requires-code-coverage-driver.php';
@@ -15,21 +16,19 @@ if (!function_exists('opcache_compile_file')) {
1516
--FILE--
1617
<?php declare(strict_types=1);
1718
$_SERVER['argv'][] = '--do-not-cache-result';
18-
$_SERVER['argv'][] = '--no-configuration';
19-
$_SERVER['argv'][] = '--bootstrap';
20-
$_SERVER['argv'][] = __DIR__ . '/ignore-class-using-attribute/src/CoveredClass.php';
21-
$_SERVER['argv'][] = '--coverage-filter';
22-
$_SERVER['argv'][] = __DIR__ . '/ignore-class-using-attribute/src';
19+
$_SERVER['argv'][] = '--colors=never';
2320
$_SERVER['argv'][] = '--coverage-text';
24-
$_SERVER['argv'][] = __DIR__ . '/ignore-class-using-attribute/tests';
21+
$_SERVER['argv'][] = '--configuration';
22+
$_SERVER['argv'][] = __DIR__ . '/warn-when-opcache-enabled/phpunit.xml';
2523

26-
require_once __DIR__ . '/../../bootstrap.php';
24+
require_once __DIR__ . '/../../../../bootstrap.php';
2725

2826
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
2927
--EXPECTF--
3028
PHPUnit %s by Sebastian Bergmann and contributors.
3129

3230
Runtime: %s
31+
Configuration: %s
3332

3433
. 1 / 1 (100%)
3534

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
bootstrap="src/Greeter.php"
5+
executionOrder="depends,defects"
6+
requireCoverageMetadata="true"
7+
beStrictAboutCoverageMetadata="true"
8+
beStrictAboutOutputDuringTests="true"
9+
failOnRisky="true"
10+
failOnWarning="true">
11+
<testsuites>
12+
<testsuite name="default">
13+
<directory>tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
17+
<source restrictNotices="true" restrictWarnings="true">
18+
<include>
19+
<directory>src</directory>
20+
</include>
21+
</source>
22+
</phpunit>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
namespace PHPUnit\TestFixture\WarnWhenOpcacheEnabled;
11+
12+
final class Greeter
13+
{
14+
public function greet(): string
15+
{
16+
return 'Hello world!';
17+
}
18+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
namespace PHPUnit\TestFixture\WarnWhenOpcacheEnabled;
11+
12+
use PHPUnit\Framework\Attributes\CoversClass;
13+
use PHPUnit\Framework\TestCase;
14+
15+
#[CoversClass(Greeter::class)]
16+
final class GreeterTest extends TestCase
17+
{
18+
public function testGreets(): void
19+
{
20+
$this->assertSame('Hello world!', (new Greeter)->greet());
21+
}
22+
}

0 commit comments

Comments
 (0)