---
title: "rector-phpunit/composer-based set"
pagination: false
---

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

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

```toml
[lint]
sets = ["rector-phpunit/composer-based"]
```

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 (52)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/phpunit/add-allow-mock-objects-attribute`](/docs/rules/lint/phpunit/add-allow-mock-objects-attribute) | `AllowMockObjectsWhereParentClassRector` | Ported |
| [`lint/phpunit/add-data-provider-allow-mock-objects`](/docs/rules/lint/phpunit/add-data-provider-allow-mock-objects) | `AllowMockObjectsForDataProviderRector` | Ported |
| [`lint/phpunit/add-does-not-perform-assertions`](/docs/rules/lint/phpunit/add-does-not-perform-assertions) | `AddDoesNotPerformAssertionToNonAssertingTestRector` | Ported |
| [`lint/phpunit/add-mock-intersection-param`](/docs/rules/lint/phpunit/add-mock-intersection-param) | `AddIntersectionParamToMockObjectParamRector` | Ported |
| [`lint/phpunit/add-mock-intersection-type`](/docs/rules/lint/phpunit/add-mock-intersection-type) | `AddIntersectionVarToMockObjectPropertyRector` | Ported |
| [`lint/phpunit/add-mock-object-type`](/docs/rules/lint/phpunit/add-mock-object-type) | `ExpectsParamToMockObjectRector` | Ported |
| [`lint/phpunit/add-parent-test-constructor`](/docs/rules/lint/phpunit/add-parent-test-constructor) | `ParentTestClassConstructorRector` | Ported |
| [`lint/phpunit/add-prophecy-trait`](/docs/rules/lint/phpunit/add-prophecy-trait) | `AddProphecyTraitRector` | Ported |
| [`lint/phpunit/add-stub-intersection-type`](/docs/rules/lint/phpunit/add-stub-intersection-type) | `AddStubIntersectionVarToStubPropertyRector` | Ported |
| [`lint/phpunit/no-any-matcher`](/docs/rules/lint/phpunit/no-any-matcher) | `AnyMatcherToNewAnyInvokedCountRector` | Ported |
| [`lint/phpunit/no-assert-class-has-attribute`](/docs/rules/lint/phpunit/no-assert-class-has-attribute) | `PropertyExistsWithoutAssertRector` | Ported |
| [`lint/phpunit/no-assert-contains-on-string`](/docs/rules/lint/phpunit/no-assert-contains-on-string) | `SpecificAssertContainsRector` | Ported |
| [`lint/phpunit/no-assert-contains-only`](/docs/rules/lint/phpunit/no-assert-contains-only) | `AssertContainsOnlyMethodCallRector` | Ported |
| [`lint/phpunit/no-assert-internal-type`](/docs/rules/lint/phpunit/no-assert-internal-type) | `SpecificAssertInternalTypeRector` | Ported |
| [`lint/phpunit/no-assert-is-type`](/docs/rules/lint/phpunit/no-assert-is-type) | `AssertIsTypeMethodCallRector` | 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-data-provider-test-prefix`](/docs/rules/lint/phpunit/no-data-provider-test-prefix) | `RemoveDataProviderTestPrefixRector` | Ported |
| [`lint/phpunit/no-expected-exception-annotation`](/docs/rules/lint/phpunit/no-expected-exception-annotation) | `ExceptionAnnotationRector` | Ported |
| [`lint/phpunit/no-expects-any`](/docs/rules/lint/phpunit/no-expects-any) | `RemoveExpectAnyFromMockRector` | Ported |
| [`lint/phpunit/no-final-constructor-override`](/docs/rules/lint/phpunit/no-final-constructor-override) | `RemoveOverrideFinalConstructTestCaseRector` | Ported |
| [`lint/phpunit/no-mock-builder-set-methods`](/docs/rules/lint/phpunit/no-mock-builder-set-methods) | `RemoveSetMethodsMethodCallRector` | Ported |
| [`lint/phpunit/no-scenario-annotation`](/docs/rules/lint/phpunit/no-scenario-annotation) | `ScenarioToTestAnnotationRector` | Ported |
| [`lint/phpunit/no-stub-with-expectations`](/docs/rules/lint/phpunit/no-stub-with-expectations) | `MockObjectArgCreateStubToCreateMockRector` | Ported |
| [`lint/phpunit/no-test-listener`](/docs/rules/lint/phpunit/no-test-listener) | `TestListenerToHooksRector` | Ported |
| [`lint/phpunit/no-with-consecutive`](/docs/rules/lint/phpunit/no-with-consecutive) | `WithConsecutiveRector` | Ported |
| [`lint/phpunit/prefer-assert-contains-equals`](/docs/rules/lint/phpunit/prefer-assert-contains-equals) | `SpecificAssertContainsWithoutIdentityRector` | Ported |
| [`lint/phpunit/prefer-assert-matches-regular-expression`](/docs/rules/lint/phpunit/prefer-assert-matches-regular-expression) | `AssertRegExpRector` | Ported |
| [`lint/phpunit/prefer-attribute-over-annotation`](/docs/rules/lint/phpunit/prefer-attribute-over-annotation) | `AnnotationWithValueToAttributeRector` | Ported |
| [`lint/phpunit/prefer-covers-attribute`](/docs/rules/lint/phpunit/prefer-covers-attribute) | `CoversAnnotationWithValueToAttributeRector` | Ported |
| [`lint/phpunit/prefer-create-mock`](/docs/rules/lint/phpunit/prefer-create-mock) | `GetMockRector` | 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-create-stub-in-coalesce`](/docs/rules/lint/phpunit/prefer-create-stub-in-coalesce) | `CreateStubInCoalesceArgRector` | Ported |
| [`lint/phpunit/prefer-data-provider-attribute`](/docs/rules/lint/phpunit/prefer-data-provider-attribute) | `DataProviderAnnotationToAttributeRector` | Ported |
| [`lint/phpunit/prefer-depends-attribute`](/docs/rules/lint/phpunit/prefer-depends-attribute) | `DependsAnnotationWithValueToAttributeRector` | Ported |
| [`lint/phpunit/prefer-expect-exception`](/docs/rules/lint/phpunit/prefer-expect-exception) | `DelegateExceptionArgumentsRector` | Ported |
| [`lint/phpunit/prefer-expect-php-error`](/docs/rules/lint/phpunit/prefer-expect-php-error) | `ExplicitPhpErrorApiRector` | Ported |
| [`lint/phpunit/prefer-named-data-provider-keys`](/docs/rules/lint/phpunit/prefer-named-data-provider-keys) | `NamedArgumentForDataProviderRector` | Ported |
| [`lint/phpunit/prefer-requires-attribute`](/docs/rules/lint/phpunit/prefer-requires-attribute) | `RequiresAnnotationWithValueToAttributeRector` | Ported |
| [`lint/phpunit/prefer-specific-assert-equals`](/docs/rules/lint/phpunit/prefer-specific-assert-equals) | `AssertEqualsParameterToSpecificMethodsTypeRector` | Ported |
| [`lint/phpunit/prefer-stub-var`](/docs/rules/lint/phpunit/prefer-stub-var) | `MockObjectVarToStubRector` | Ported |
| [`lint/phpunit/prefer-test-with-attribute`](/docs/rules/lint/phpunit/prefer-test-with-attribute) | `TestWithAnnotationToAttributeRector` | Ported |
| [`lint/phpunit/prefer-ticket-attribute`](/docs/rules/lint/phpunit/prefer-ticket-attribute) | `TicketAnnotationToAttributeRector` | Ported |
| [`lint/phpunit/require-public-data-provider`](/docs/rules/lint/phpunit/require-public-data-provider) | `PublicDataProviderClassMethodRector` | Ported |
| [`lint/phpunit/require-static-data-provider`](/docs/rules/lint/phpunit/require-static-data-provider) | `StaticDataProviderClassMethodRector` | Ported |
| [`lint/refactor/add-param-type`](/docs/rules/lint/refactor/add-param-type) | `AddParamTypeDeclarationRector` | Ported |
| [`lint/refactor/add-return-type`](/docs/rules/lint/refactor/add-return-type) | `AddReturnTypeDeclarationRector` | Ported |
| [`lint/refactor/prefer-attribute-over-annotation`](/docs/rules/lint/refactor/prefer-attribute-over-annotation) | `AnnotationToAttributeRector` | Ported |
| [`lint/refactor/rename-class`](/docs/rules/lint/refactor/rename-class) | `RenameClassRector` | Ported |
| [`lint/refactor/rename-method`](/docs/rules/lint/refactor/rename-method) | `RenameMethodRector` | Ported |
