File tree Expand file tree Collapse file tree 7 files changed +19
-53
lines changed
tests/end-to-end/code-coverage/code-coverage Expand file tree Collapse file tree 7 files changed +19
-53
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
declare (strict_types=1 );
4
- /*
5
- * This file is part of PHPUnit.
6
- *
7
- * (c) Sebastian Bergmann <[email protected] >
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
- require_once __DIR__ . '/src/Method.php ' ;
13
4
14
- require_once __DIR__ . '/src/FullyTestedClass .php ' ;
15
-
16
- require_once __DIR__ . '/src/functions.php ' ;
5
+ require_once __DIR__ . '/src/Method .php ' ;
6
+ require_once __DIR__ . ' /src/FullyTestedClass.php ' ;
7
+ require_once __DIR__ . '/src/functions.php ' ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
declare (strict_types=1 );
4
- /*
5
- * This file is part of PHPUnit.
6
- *
7
- * (c) Sebastian Bergmann <[email protected] >
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
- namespace PHPUnit \TestFixture \CodeCoverage ;
13
4
5
+ namespace PHPUnit \TestFixture \CodeCoverage ;
14
6
/*
15
7
* This file is part of PHPUnit.
16
8
*
Original file line number Diff line number Diff line change 9
9
* For the full copyright and license information, please view the LICENSE
10
10
* file that was distributed with this source code.
11
11
*/
12
+
12
13
namespace PHPUnit \TestFixture \CodeCoverage ;
13
14
14
15
final class Method
@@ -18,13 +19,13 @@ public function greet(): string
18
19
return $ this ->internalMethod ();
19
20
}
20
21
21
- public function unusedPublicMethod (): string
22
+ private function internalMethod (): string
22
23
{
23
- return 'never returned ' ;
24
+ return 'Hello, World! ' ;
24
25
}
25
26
26
- private function internalMethod (): string
27
+ public function unusedPublicMethod (): string
27
28
{
28
- return 'Hello, World! ' ;
29
+ return 'never returned ' ;
29
30
}
30
31
}
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
declare (strict_types=1 );
4
- /*
5
- * This file is part of PHPUnit.
6
- *
7
- * (c) Sebastian Bergmann <[email protected] >
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
4
+
12
5
namespace PHPUnit \TestFixture \CodeCoverage ;
13
6
14
7
/*
20
13
* file that was distributed with this source code.
21
14
*/
22
15
16
+
23
17
function fixture_for_phpunit_code_coverage (): bool
24
18
{
25
19
return true ;
26
20
}
27
21
22
+
28
23
function fixture_for_phpunit_code_coverage_not_called (): bool
29
24
{
30
25
return false ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
declare (strict_types=1 );
4
- /*
5
- * This file is part of PHPUnit.
6
- *
7
- * (c) Sebastian Bergmann <[email protected] >
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
4
+
12
5
namespace PHPUnit \TestFixture \CodeCoverage ;
13
6
14
7
/*
21
14
*/
22
15
23
16
use PHPUnit \Framework \Attributes \CoversClass ;
24
- use PHPUnit \Framework \TestCase ;
25
17
26
- #[CoversClass(FullyTestedClass::class)]
27
- class FullyTestedClassTest extends TestCase
18
+ #[CoversClass(\ PHPUnit \ TestFixture \ CodeCoverage \ FullyTestedClass::class)]
19
+ class FullyTestedClassTest extends \ PHPUnit \ Framework \ TestCase
28
20
{
29
21
public function testMethod (): void
30
22
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
declare (strict_types=1 );
4
- /*
5
- * This file is part of PHPUnit.
6
- *
7
- * (c) Sebastian Bergmann <[email protected] >
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
4
+
12
5
namespace PHPUnit \TestFixture \CodeCoverage ;
13
6
14
7
/*
20
13
* file that was distributed with this source code.
21
14
*/
22
15
16
+
23
17
use PHPUnit \Framework \Attributes \CoversFunction ;
24
18
use PHPUnit \Framework \TestCase ;
25
19
Original file line number Diff line number Diff line change 9
9
* For the full copyright and license information, please view the LICENSE
10
10
* file that was distributed with this source code.
11
11
*/
12
+
12
13
namespace PHPUnit \TestFixture \CodeCoverage ;
13
14
14
15
use PHPUnit \Framework \Attributes \CoversClass ;
15
16
use PHPUnit \Framework \TestCase ;
16
17
17
- #[CoversClass(Method::class)]
18
+ #[CoversClass(\ PHPUnit \ TestFixture \ CodeCoverage \ Method::class)]
18
19
final class MethodTest extends TestCase
19
20
{
20
21
public function testMethod (): void
You can’t perform that action at this time.
0 commit comments