File tree Expand file tree Collapse file tree 5 files changed +69
-7
lines changed
warn-when-opcache-enabled Expand file tree Collapse file tree 5 files changed +69
-7
lines changed Original file line number Diff line number Diff line change 7
7
<testsuites >
8
8
<testsuite name =" default" >
9
9
<directory >tests/standard</directory >
10
+ <directory >tests/code-coverage</directory >
10
11
<directory suffix =" phpt" >tests/phpt</directory >
11
12
</testsuite >
12
13
</testsuites >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ https://github.com/sebastianbergmann/php-code-coverage/issues/1022
3
3
--INI--
4
4
opcache.enable_cli=1
5
5
opcache.jit=disable
6
+ pcov.directory=tests/end-to-end/phar/tests/code-coverage/warn-when-opcache-enabled/src/
6
7
--SKIPIF--
7
8
<?php declare (strict_types=1 );
8
9
require __DIR__ . '/../../_files/skip-if-requires-code-coverage-driver.php ' ;
@@ -15,21 +16,19 @@ if (!function_exists('opcache_compile_file')) {
15
16
--FILE --
16
17
<?php declare (strict_types=1 );
17
18
$ _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 ' ;
23
20
$ _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 ' ;
25
23
26
- require_once __DIR__ . '/../../bootstrap.php ' ;
24
+ require_once __DIR__ . '/../../../../ bootstrap.php ' ;
27
25
28
26
(new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
29
27
--EXPECTF --
30
28
PHPUnit %s by Sebastian Bergmann and contributors.
31
29
32
30
Runtime: %s
31
+ Configuration: %s
33
32
34
33
. 1 / 1 (100 %)
35
34
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments