---
title: "lint/phpunit/no-mock-builder-set-methods"
pagination: false
---

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

<RuleId id="lint/phpunit/no-mock-builder-set-methods" />

Not in any preset. In Rector's [`rector-phpunit/composer-based`](/docs/rules/sets/rector-phpunit/composer-based) set. Needs the [`phpunit` extension](/docs/configuration/pun-toml#extensions). Unsafe fix: it can change behavior.

## What it does

Remove "setMethods()" method as never used, move methods to "addMethods()" if non-existent or @method magic

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/no-mock-builder-set-methods" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`RemoveSetMethodsMethodCall`](https://getrector.com/rule-detail/remove-set-methods-method-call-rector) (rector-phpunit)

[More lint/phpunit rules](/docs/rules/lint/phpunit) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
