<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw" -->

---
title: Migrating to PHPUnit 9 | daily.dev
description: PHPUnit 9 was released with a focus on cleaning up deprecated APIs rather than adding new features. Key breaking changes include: removal of optional...
canonical: https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Migrating to PHPUnit 9 | daily.dev
og:description: PHPUnit 9 was released with a focus on cleaning up deprecated APIs rather than adding new features. Key breaking changes include: removal of optional...
og:url: https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw
og:image: https://api.daily.dev/og/posts/jMt8Wsszw.png
og:image:alt: Migrating to PHPUnit 9
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating to PHPUnit 9

**[PHPUnit Expert](https://daily.dev/sources/phpunit-expert)** · 15 min read · 0 upvotes · 0 comments

## Summary

PHPUnit 9 was released with a focus on cleaning up deprecated APIs rather than adding new features. Key breaking changes include: removal of optional parameters from assertEquals() (replaced by assertEqualsWithDelta, assertEqualsCanonicalizing, assertEqualsIgnoringCase), removal of string haystack support from assertContains(), removal of assertInternalType() in favor of type-specific methods like assertIsArray(), removal of assertArraySubset(), removal of assertion methods for non-public properties, and removal of @expectedException annotation support. PHPUnit 9 requires PHP 7.3+. The post explains the philosophy behind annual major version releases: functionality is deprecated one year before removal, giving developers time to adapt incrementally. The author also discusses ongoing evolutionary refactoring efforts including XML config rewriting and a planned event-based extension system.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://phpunit.expert/articles/migrating-to-phpunit-9.html>

## Similar posts on daily.dev

- [Upgrading PHPUnit should be boring](https://daily.dev/posts/upgrading-phpunit-should-be-boring-og0pexkx1) · PHPUnit Expert · 0 upvotes · 0 comments
- [Join the PHPUnit test cleanup for 7.2](https://daily.dev/posts/join-the-phpunit-test-cleanup-for-7-2-pnxhpj9it) · Make WordPress Core · 0 upvotes · 0 comments
- [Precision and Clarity: What is New in PHPUnit 13.2?](https://daily.dev/posts/precision-and-clarity-what-is-new-in-phpunit-13-2--aparnuw4v) · PHPUnit Expert · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#phpunit](https://daily.dev/tags/phpunit), [#semantic-versioning](https://daily.dev/tags/semantic-versioning), [#testing](https://daily.dev/tags/testing)

[View this post on daily.dev](https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Migrating to PHPUnit 9","url":"https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw"},"datePublished":"2026-03-31T13:34:21.771Z","dateModified":"2026-10-14T02:25:24.589Z","description":"PHPUnit 9 was released with a focus on cleaning up deprecated APIs rather than adding new features. Key breaking changes include: removal of optional...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/73476f7f0de09fdbe95a9d45c0f86024?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/73476f7f0de09fdbe95a9d45c0f86024?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"PHPUnit Expert","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"PHPUnit Expert","logo":"https://media.daily.dev/image/upload/s--FMZoysoG--/f_auto,q_auto/v1774964057/logos/phpunit-expert?_a=BAMAMiWQ0","url":"https://daily.dev/sources/phpunit-expert"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/migrating-to-phpunit-9-jmt8wsszw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,phpunit,semantic-versioning,testing","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHPUnit Expert","item":"https://daily.dev/sources/phpunit-expert"},{"@type":"ListItem","position":3,"name":"Migrating to PHPUnit 9"}]}
```

