---
title: "rector-phpunit/phpunit-code-quality set"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

rector-phpunit's `phpunit-code-quality` set: the Pun lint rules its Rector rules map to, and nothing else.

```toml
[lint]
sets = ["rector-phpunit/phpunit-code-quality"]
```

A rule merged from several Rector rules runs only the rewrites of this set's Rector rules, unless a [preset](/docs/configuration/presets#lint-presets) also turns it on. Rector rules that are format rules in Pun run under `[format]` instead. Laravel, Pest, and PHPUnit rules also need their [extension](/docs/configuration/pun-toml#extensions).

## Rules (62)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/phpunit/add-depended-test-return-type`](/docs/rules/lint/phpunit/add-depended-test-return-type) | `AddReturnTypeToDependedRector` | Ported |
| [`lint/phpunit/add-instanceof-assert`](/docs/rules/lint/phpunit/add-instanceof-assert) | `AddInstanceofAssertForNullableInstanceRector` | Ported |
| [`lint/phpunit/add-instanceof-assert-for-argument`](/docs/rules/lint/phpunit/add-instanceof-assert-for-argument) | `AddInstanceofAssertForNullableArgumentRector` | Ported |
| [`lint/phpunit/add-param-type-depends`](/docs/rules/lint/phpunit/add-param-type-depends) | `AddParamTypeFromDependsRector` | Ported |
| [`lint/phpunit/add-stub-intersection-type`](/docs/rules/lint/phpunit/add-stub-intersection-type) | `AddStubIntersectionVarToStubPropertyRector` | Ported |
| [`lint/phpunit/add-will-return-callback-false-fallback`](/docs/rules/lint/phpunit/add-will-return-callback-false-fallback) | `WillReturnCallbackFallbackToReturnFalseRector` | Ported |
| [`lint/phpunit/add-will-return-callback-param-type`](/docs/rules/lint/phpunit/add-will-return-callback-param-type) | `TypeWillReturnCallableArrowFunctionRector` | Ported |
| [`lint/phpunit/no-assert-same-type-mismatch`](/docs/rules/lint/phpunit/no-assert-same-type-mismatch) | `MatchAssertSameExpectedTypeRector` | Ported |
| [`lint/phpunit/no-at-matcher`](/docs/rules/lint/phpunit/no-at-matcher) | `ReplaceAtMethodWithDesiredMatcherRector` | Ported |
| [`lint/phpunit/no-bare-mock-assign`](/docs/rules/lint/phpunit/no-bare-mock-assign) | `BareCreateMockAssignToDirectUseRector` | Ported |
| [`lint/phpunit/no-bare-mock-builder`](/docs/rules/lint/phpunit/no-bare-mock-builder) | `GetMockBuilderGetMockToCreateMockRector` | Ported |
| [`lint/phpunit/no-empty-test`](/docs/rules/lint/phpunit/no-empty-test) | `RemoveEmptyTestMethodRector` | Ported |
| [`lint/phpunit/no-entity-mock`](/docs/rules/lint/phpunit/no-entity-mock) | `EntityDocumentCreateMockToDirectNewRector` | Ported |
| [`lint/phpunit/no-expects-any`](/docs/rules/lint/phpunit/no-expects-any) | `RemoveExpectAnyFromMockRector` | Ported |
| [`lint/phpunit/no-flipped-assertion`](/docs/rules/lint/phpunit/no-flipped-assertion) | `FlipAssertRector` | Ported |
| [`lint/phpunit/no-float-delta-parameter`](/docs/rules/lint/phpunit/no-float-delta-parameter) | `AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector` | Ported |
| [`lint/phpunit/no-mock-intersection-property`](/docs/rules/lint/phpunit/no-mock-intersection-property) | `SingleMockPropertyTypeRector` | Ported |
| [`lint/phpunit/no-negated-assertion`](/docs/rules/lint/phpunit/no-negated-assertion) | `AssertNotOperatorRector` | Ported |
| [`lint/phpunit/no-setup-override-attribute`](/docs/rules/lint/phpunit/no-setup-override-attribute) | `NoSetupWithParentCallOverrideRector` | Ported |
| [`lint/phpunit/no-test-constructor`](/docs/rules/lint/phpunit/no-test-constructor) | `ConstructClassMethodToSetUpTestCaseRector` | Ported |
| [`lint/phpunit/no-unused-mock`](/docs/rules/lint/phpunit/no-unused-mock) | `RemoveStandaloneCreateMockRector` | Ported |
| [`lint/phpunit/no-unused-mock-property`](/docs/rules/lint/phpunit/no-unused-mock-property) | `RemoveNeverUsedMockPropertyRector` | Ported |
| [`lint/phpunit/no-value-object-mock`](/docs/rules/lint/phpunit/no-value-object-mock) | `DirectInstanceOverMockArgRector` | Ported |
| [`lint/phpunit/prefer-assert`](/docs/rules/lint/phpunit/prefer-assert) | `AssertFuncCallToPHPUnitAssertRector` | Ported |
| [`lint/phpunit/prefer-assert-array-has-key`](/docs/rules/lint/phpunit/prefer-assert-array-has-key) | `AssertIssetToSpecificMethodRector` | Ported |
| [`lint/phpunit/prefer-assert-count`](/docs/rules/lint/phpunit/prefer-assert-count) | `AssertCompareOnCountableWithMethodToAssertCountRector` | Ported |
| [`lint/phpunit/prefer-assert-instanceof`](/docs/rules/lint/phpunit/prefer-assert-instanceof) | `AssertInstanceOfComparisonRector` | Ported |
| [`lint/phpunit/prefer-assert-instanceof-over-empty`](/docs/rules/lint/phpunit/prefer-assert-instanceof-over-empty) | `AssertEmptyNullableObjectToAssertInstanceofRector` | Ported |
| [`lint/phpunit/prefer-assert-instances-of`](/docs/rules/lint/phpunit/prefer-assert-instances-of) | `SimplifyForeachInstanceOfRector` | Ported |
| [`lint/phpunit/prefer-assert-null-true-false`](/docs/rules/lint/phpunit/prefer-assert-null-true-false) | `AssertSameBoolNullToSpecificMethodRector` | Ported |
| [`lint/phpunit/prefer-assert-same`](/docs/rules/lint/phpunit/prefer-assert-same) | `AssertEqualsToSameRector` | Ported |
| [`lint/phpunit/prefer-assert-string-contains`](/docs/rules/lint/phpunit/prefer-assert-string-contains) | `AssertFalseStrposToContainsRector` | Ported |
| [`lint/phpunit/prefer-assert-true-false`](/docs/rules/lint/phpunit/prefer-assert-true-false) | `AssertSameTrueFalseToAssertTrueFalseRector` | Ported |
| [`lint/phpunit/prefer-comparison-assertion`](/docs/rules/lint/phpunit/prefer-comparison-assertion) | `AssertComparisonToSpecificMethodRector` | Ported |
| [`lint/phpunit/prefer-create-stub`](/docs/rules/lint/phpunit/prefer-create-stub) | `PropertyCreateMockToCreateStubRector` | Ported |
| [`lint/phpunit/prefer-create-stub-argument`](/docs/rules/lint/phpunit/prefer-create-stub-argument) | `CreateStubOverCreateMockArgRector` | Ported |
| [`lint/phpunit/prefer-create-stub-expression`](/docs/rules/lint/phpunit/prefer-create-stub-expression) | `ExpressionCreateMockToCreateStubRector` | Ported |
| [`lint/phpunit/prefer-data-provider`](/docs/rules/lint/phpunit/prefer-data-provider) | `TestWithToDataProviderRector` | Ported |
| [`lint/phpunit/prefer-inline-create-stub`](/docs/rules/lint/phpunit/prefer-inline-create-stub) | `InlineStubPropertyToCreateStubMethodCallRector` | Ported |
| [`lint/phpunit/prefer-local-over-setup-property`](/docs/rules/lint/phpunit/prefer-local-over-setup-property) | `NarrowUnusedSetUpDefinedPropertyRector` | Ported |
| [`lint/phpunit/prefer-mock-intersection-return`](/docs/rules/lint/phpunit/prefer-mock-intersection-return) | `ChangeMockObjectReturnUnionToIntersectionRector` | Ported |
| [`lint/phpunit/prefer-narrow-will-return-callback`](/docs/rules/lint/phpunit/prefer-narrow-will-return-callback) | `NarrowSingleWillReturnCallbackRector` | Ported |
| [`lint/phpunit/prefer-narrow-with-consecutive`](/docs/rules/lint/phpunit/prefer-narrow-with-consecutive) | `NarrowIdenticalWithConsecutiveRector` | Ported |
| [`lint/phpunit/prefer-property-assertions`](/docs/rules/lint/phpunit/prefer-property-assertions) | `AssertArrayCastedObjectToAssertSameRector` | Ported |
| [`lint/phpunit/prefer-simple-callback-assert`](/docs/rules/lint/phpunit/prefer-simple-callback-assert) | `CallbackSingleAssertToSimplerRector` | Ported |
| [`lint/phpunit/prefer-simple-mock-expectation`](/docs/rules/lint/phpunit/prefer-simple-mock-expectation) | `SingleWithConsecutiveToWithRector` | Ported |
| [`lint/phpunit/prefer-simple-with-matcher`](/docs/rules/lint/phpunit/prefer-simple-with-matcher) | `UseSpecificWithMethodRector` | Ported |
| [`lint/phpunit/prefer-specific-true-false-assertion`](/docs/rules/lint/phpunit/prefer-specific-true-false-assertion) | `AssertTrueFalseToSpecificMethodRector` | Ported |
| [`lint/phpunit/prefer-specific-will-method`](/docs/rules/lint/phpunit/prefer-specific-will-method) | `UseSpecificWillMethodRector` | Ported |
| [`lint/phpunit/prefer-standalone-asserts-over-callback`](/docs/rules/lint/phpunit/prefer-standalone-asserts-over-callback) | `WithCallbackIdenticalToStandaloneAssertsRector` | Ported |
| [`lint/phpunit/prefer-stub-var`](/docs/rules/lint/phpunit/prefer-stub-var) | `MockObjectVarToStubRector` | Ported |
| [`lint/phpunit/prefer-test-prefix`](/docs/rules/lint/phpunit/prefer-test-prefix) | `ReplaceTestAnnotationWithPrefixedFunctionRector` | Ported |
| [`lint/phpunit/prefer-this-call`](/docs/rules/lint/phpunit/prefer-this-call) | `PreferPHPUnitThisCallRector` | Ported |
| [`lint/phpunit/prefer-will-return-callback`](/docs/rules/lint/phpunit/prefer-will-return-callback) | `MergeWithCallableAndWillReturnRector`, `VoidMethodWithCallbackToWillReturnCallbackRector` | Ported |
| [`lint/phpunit/prefer-with-is-instance-of`](/docs/rules/lint/phpunit/prefer-with-is-instance-of) | `SimplerWithIsInstanceOfRector` | Ported |
| [`lint/phpunit/prefer-yield-data-provider`](/docs/rules/lint/phpunit/prefer-yield-data-provider) | `YieldDataProviderRector` | Ported |
| [`lint/phpunit/require-data-provider-newlines`](/docs/rules/lint/phpunit/require-data-provider-newlines) | `DataProviderArrayItemsNewLinedRector` | Ported |
| [`lint/phpunit/require-exact-test-argument-type`](/docs/rules/lint/phpunit/require-exact-test-argument-type) | `ScalarArgumentToExpectedParamTypeRector` | Ported |
| [`lint/phpunit/require-final-test-case`](/docs/rules/lint/phpunit/require-final-test-case) | `FinalizeTestCaseClassRector` | Ported |
| [`lint/phpunit/require-mock-expects`](/docs/rules/lint/phpunit/require-mock-expects) | `DecorateWillReturnMapWithExpectsMockRector` | Ported |
| [`lint/phpunit/require-strict-types-in-tests`](/docs/rules/lint/phpunit/require-strict-types-in-tests) | `DeclareStrictTypesTestsRector` | Ported |
| [`lint/phpunit/require-string-assert-argument`](/docs/rules/lint/phpunit/require-string-assert-argument) | `StringCastAssertStringContainsStringRector` | Ported |
