---
title: "rector-phpunit/phpunit-mock-to-stub set"
pagination: false
---

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

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

```toml
[lint]
sets = ["rector-phpunit/phpunit-mock-to-stub"]
```

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

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`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-stub-intersection-type`](/docs/rules/lint/phpunit/add-stub-intersection-type) | `AddStubIntersectionVarToStubPropertyRector` | Ported |
| [`lint/phpunit/no-bare-mock-assign`](/docs/rules/lint/phpunit/no-bare-mock-assign) | `BareCreateMockAssignToDirectUseRector` | Ported |
| [`lint/phpunit/no-stub-with-expectations`](/docs/rules/lint/phpunit/no-stub-with-expectations) | `MockObjectArgCreateStubToCreateMockRector` | 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-stub-var`](/docs/rules/lint/phpunit/prefer-stub-var) | `MockObjectVarToStubRector` | Ported |
