---
title: "lint/phpunit/prefer-new-assertion-names"
pagination: false
---

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

<RuleId id="lint/phpunit/prefer-new-assertion-names" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Unsafe fix: it can change behaviour. Runs when phpunit is installed.

## What it does

Rename deprecated PHPUnit assertions like `assertFileNotExists` to new methods like `assertFileDoesNotExist`.

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/prefer-new-assertion-names" = "error"
```

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

## Replaces

- [`php_unit_assert_new_names`](https://cs.symfony.com/doc/rules/php_unit/php_unit_assert_new_names.html) (php-cs-fixer, risky)

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