Verified Commit 4624601e authored by quietone's avatar quietone
Browse files

Issue #3556582 by mondrake, dcam: Remove remaining references to @covers* annotations from tests

(cherry picked from commit c0fea6f9)
parent 6688407e
Loading
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1150,15 +1150,13 @@
 *     subdirectory)
 *
 * Some notes about writing PHP test classes:
 * - The class needs a phpDoc comment block with a description and
 *   @group annotation, which gives information about the test.
 * - For unit tests, this comment block should also have @coversDefaultClass
 *   annotation.
 * - The class needs a phpDoc comment block with a description of the test, and
 *   a #[Group(...)] attribute, which gives information about the test.
 * - For unit tests, this comment block should also have a #[CoversClass(...)]
 *   attribute.
 * - When writing tests, put the test code into public methods, each covering a
 *   logical subset of the functionality that is being tested.
 * - The test methods must have names starting with 'test'. For unit tests, the
 *   test methods need to have a phpDoc block with @covers annotation telling
 *   which class method they are testing.
 * - The test methods must have names starting with 'test'.
 * - In some cases, you may need to write a test module to support your test;
 *   put such modules under the your_module/tests/modules directory.
 *
+2 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

use Drupal\Core\Database\Database;
use Drupal\jsonapi\ResourceType\ResourceType;
use Drupal\jsonapi\ResourceType\ResourceTypeRepository;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\jsonapi\Kernel\JsonapiKernelTestBase;
use PHPUnit\Framework\Attributes\CoversClass;
@@ -16,11 +17,10 @@
/**
 * Tests Drupal\jsonapi\ResourceType\ResourceType.
 *
 * @coversClass \Drupal\jsonapi\ResourceType\ResourceTypeRepository
 *
 * @internal
 */
#[CoversClass(ResourceType::class)]
#[CoversClass(ResourceTypeRepository::class)]
#[Group('jsonapi')]
#[RunTestsInSeparateProcesses]
class RelatedResourceTypesTest extends JsonapiKernelTestBase {
+3 −2
Original line number Diff line number Diff line
@@ -7,22 +7,23 @@
use Drupal\Core\Render\Markup;
use Drupal\jsonapi\JsonApiResource\ResourceObject;
use Drupal\jsonapi\Normalizer\Value\CacheableNormalization;
use Drupal\jsonapi\Serializer\Serializer;
use Drupal\jsonapi_test_data_type\TraversableObject;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\jsonapi\Kernel\JsonapiKernelTestBase;
use Drupal\user\Entity\User;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests the JSON:API serializer.
 *
 * @coversClass \Drupal\jsonapi\Serializer\Serializer
 *
 * @internal
 */
#[Group('jsonapi')]
#[CoversClass(Serializer::class)]
#[RunTestsInSeparateProcesses]
class SerializerTest extends JsonapiKernelTestBase {

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ abstract class MediaEmbedFilterTestBase extends MediaJavascriptTestBase {
   */
  public static function setUpBeforeClass(): void {
    parent::setUpBeforeClass();
    // Necessary for @covers to work.
    // Necessary for code coverage to work.
    require_once __DIR__ . '/../../../media.module';
  }

+1 −2
Original line number Diff line number Diff line
@@ -7,8 +7,7 @@
use org\bovigo\vfs\vfsStream;

/**
 * @coversDefaultClass \Drupal\Core\Hook\HookCollectorPass
 * @group Hook
 * Setup group includes trait.
 */
trait GroupIncludesTestTrait {

Loading