Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.09 KB

php_unit_internal_class.rst

File metadata and controls

65 lines (45 loc) · 1.09 KB

Rule php_unit_internal_class

All PHPUnit test classes should be marked as internal.

Configuration

types

What types of classes to mark as internal.

Allowed values: a subset of ['abstract', 'final', 'normal']

Default value: ['normal', 'final']

Examples

Example #1

Default configuration.

--- Original
+++ New
 <?php
+
+/**
+ * @internal
+ */
 class MyTest extends TestCase {}

Example #2

With configuration: ['types' => ['final']].

--- Original
+++ New
 <?php
 class MyTest extends TestCase {}
+/**
+ * @internal
+ */
 final class FinalTest extends TestCase {}
 abstract class AbstractTest extends TestCase {}

Rule sets

The rule is part of the following rule set:

Source class

PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer