Skip to content

Commit e437714

Browse files
staabmsebastianbergmann
authored andcommitted
test method level metadata
1 parent 909b0fd commit e437714

File tree

5 files changed

+56
-5
lines changed

5 files changed

+56
-5
lines changed

tests/end-to-end/regression/6304.phpt renamed to tests/end-to-end/regression/6304-class-metadata.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://github.com/sebastianbergmann/phpunit/issues/6304
55
$_SERVER['argv'][] = '--do-not-cache-result';
66
$_SERVER['argv'][] = '--no-configuration';
77
$_SERVER['argv'][] = '--display-phpunit-deprecations';
8-
$_SERVER['argv'][] = __DIR__ . '/6304/Issue6304Test.php';
8+
$_SERVER['argv'][] = __DIR__ . '/6304/Issue6304ClassMetadataTest.php';
99

1010
require __DIR__ . '/../../bootstrap.php';
1111

@@ -21,9 +21,9 @@ Time: %s, Memory: %s MB
2121

2222
There were 2 PHPUnit test runner deprecations:
2323

24-
1) Metadata found in doc-comment for class Issue6304Test. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
24+
1) Metadata found in doc-comment for class Issue6304ClassMetadataTest. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
2525

26-
2) Metadata found in doc-comment for class Issue6304Test. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
26+
2) Metadata found in doc-comment for class Issue6304ClassMetadataTest. Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
2727

2828
OK, but there were issues!
2929
Tests: 1, Assertions: 1, PHPUnit Deprecations: 2.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6304
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = '--display-phpunit-deprecations';
8+
$_SERVER['argv'][] = __DIR__ . '/6304/Issue6304MethodMetadataTest.php';
9+
10+
require __DIR__ . '/../../bootstrap.php';
11+
12+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
13+
--EXPECTF--
14+
PHPUnit %s by Sebastian Bergmann and contributors.
15+
16+
Runtime: %s
17+
18+
. 1 / 1 (100%)
19+
20+
Time: %s, Memory: %s MB
21+
22+
There was 1 PHPUnit test runner deprecation:
23+
24+
1) Metadata found in doc-comment for method Issue6304MethodMetadataTest::testOne(). Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.
25+
26+
OK, but there were issues!
27+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/regression/6304/Issue6304Test.php renamed to tests/end-to-end/regression/6304/Issue6304ClassMetadataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @runTestsInSeparateProcesses
1818
*/
19-
final class Issue6304Test extends TestCase
19+
final class Issue6304ClassMetadataTest extends TestCase
2020
{
2121
public function testOne(): void
2222
{
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
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+
use PHPUnit\Framework\TestCase;
13+
14+
final class Issue6304MethodMetadataTest extends TestCase
15+
{
16+
/**
17+
* @group test
18+
*
19+
* @runTestsInSeparateProcesses
20+
*/
21+
public function testOne(): void
22+
{
23+
$this->assertTrue(true);
24+
}
25+
}

tests/end-to-end/regression/6329/Issue6329Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* For the full copyright and license information, please view the LICENSE
1010
* file that was distributed with this source code.
1111
*/
12-
1312
use PHPUnit\Event\Facade as EventFacade;
1413
use PHPUnit\Framework\Attributes\IgnorePhpunitDeprecations;
1514
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

0 commit comments

Comments
 (0)