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