# phpunit

Published articles for phpunit.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## \`exit()\` may silently break your parallel tests

DevFeed: [\`exit()\` may silently break your parallel tests](<https://devfeed.tech/articles/exit-may-silently-break-your-parallel-tests-33291.md>)

Original publisher: [Read original article](<https://freek.dev/3177-exit-may-silently-break-your-parallel-tests>)

Author: Freek Van der Herten (freek@spatie.be)

Published: 2026-08-12T10:30:31Z

Content type: tutorial

Language: en

Sources: [freek.dev - all blogposts](<https://devfeed.tech/sources/freek-dev-all-blogposts.md>)

Topics: [PHPUnit](<https://devfeed.tech/topics/phpunit.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [crash](<https://devfeed.tech/tags/crash.md>), [diagnostics](<https://devfeed.tech/tags/diagnostics.md>), [exception](<https://devfeed.tech/tags/exception.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [php](<https://devfeed.tech/tags/php.md>), [phpunit](<https://devfeed.tech/tags/phpunit.md>), [process](<https://devfeed.tech/tags/process.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

The article explains that calling exit() can cause parallel PHPUnit test workers to crash without useful diagnostics because the process ends outside PHPUnit's control. It recommends throwing an exception instead so the failure is reported with a stack trace.

### Source excerpt

Michael explains why exit() can make parallel test workers crash without useful diagnostics, and why verbose flags do not help when the process dies outside PHPUnit's control. The fix is simple: throw an exception instead, so the failure is reported normally with a stack trace. Read more

## Работа с частичными моками в PHPUnit 10

DevFeed: [Работа с частичными моками в PHPUnit 10](<https://devfeed.tech/articles/phpunit-10-23638.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/badoo/articles/553782/>)

Author: bikutoru (Badoo)

Published: 2021-04-26T12:15:01Z

Content type: tutorial

Language: ru

Sources: [Badoo EN](<https://devfeed.tech/sources/badoo-en.md>), [Badoo RU](<https://devfeed.tech/sources/badoo-ru.md>)

Topics: [PHPUnit](<https://devfeed.tech/topics/phpunit.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [github](<https://devfeed.tech/tags/github.md>), [phpunit](<https://devfeed.tech/tags/phpunit.md>), [tag-d343a2c2f538](<https://devfeed.tech/tags/tag-d343a2c2f538.md>), [tag-e34f6dec12c4](<https://devfeed.tech/tags/tag-e34f6dec12c4.md>), [tag-f428a971bb81](<https://devfeed.tech/tags/tag-f428a971bb81.md>)

### AI overview

The article explains partial mocks in PHPUnit 10, focusing on the removal of MockBuilder::setMethods(), problems caused by its use, available alternatives, and considerations for migrating tests.

### Source excerpt

В этом году должен выйти PHPUnit 10 (релиз планировался на 2 апреля 2021 года, но был отложен). Если посмотреть на список изменений, то бросается в глаза большое количество удалений устаревшего кода. Одним из таких изменений является удаление метода MockBuilder::setMethods(), который активно использовался при работе с частичными моками. Этот метод не рекомендуется использовать с версии 8.0, но тем не менее он описан в документации без каких-либо альтернатив и упоминания о его нежелательности. Если почитать исходники PHPUnit, issues и пул-реквесты на GitHub, то станет понятно, почему так и какие есть альтернативы. В этой статье я освещу этот нюанс для тех, кто не обращал на него внимания раньше: расскажу про частичные моки, проблемы, возникающие при работе с setMethods, пути их решения, а также затрону вопрос миграции тестов на PHPUnit 10. Читать далее

## Using XDebug with PHPUnit in PHPStorm

DevFeed: [Using XDebug with PHPUnit in PHPStorm](<https://devfeed.tech/articles/using-xdebug-with-phpunit-in-phpstorm-39021.md>)

Original publisher: [Read original article](<https://blog.jgrossi.com/2018/using-xdebug-with-phpunit-in-phpstorm/>)

Author: Junior Grossi

Published: 2018-02-16T17:00:51Z

Content type: tutorial

Language: en

Sources: [Junior Grossi](<https://devfeed.tech/sources/junior-grossi.md>)

Topics: [phpstorm](<https://devfeed.tech/topics/phpstorm.md>), [PHPUnit](<https://devfeed.tech/topics/phpunit.md>), [debug](<https://devfeed.tech/topics/debug.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [PHP](<https://devfeed.tech/topics/php.md>)

Tags: [command-line](<https://devfeed.tech/tags/command-line.md>), [configure](<https://devfeed.tech/tags/configure.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [php](<https://devfeed.tech/tags/php.md>), [phpstorm](<https://devfeed.tech/tags/phpstorm.md>), [phpunit](<https://devfeed.tech/tags/phpunit.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [xdebug](<https://devfeed.tech/tags/xdebug.md>)

### AI overview

A tutorial on configuring XDebug and PHPUnit in PHPStorm, including PHP settings, test configurations, running test suites, and debugging individual tests. It uses tests from the open-source Corcel project as an example.

### Source excerpt

Learn how to configure XDebug and PHPUnit in PHPStorm, allowing you to write better tests and fix bugs faster. Test Driven Development (TDD) is an old topic, I know, but it seems many people don't understand how it makes you write better code. The point here is that one of the most important benefits it's ... Continue reading Using XDebug with PHPUnit in PHPStorm

## PHPUnit Code Sprint at trivago Offices, Oct. 13th/14th

DevFeed: [PHPUnit Code Sprint at trivago Offices, Oct. 13th/14th](<https://devfeed.tech/articles/phpunit-code-sprint-at-trivago-offices-oct-13th-14th-28077.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/phpunit-code-sprint-2017/>)

Author: Tom Bartel

Published: 2017-08-24T00:00:00Z

Content type: article

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [PHPUnit](<https://devfeed.tech/topics/phpunit.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [community](<https://devfeed.tech/tags/community.md>), [event](<https://devfeed.tech/tags/event.md>), [germany](<https://devfeed.tech/tags/germany.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [php](<https://devfeed.tech/tags/php.md>), [phpunit](<https://devfeed.tech/tags/phpunit.md>), [test-automation](<https://devfeed.tech/tags/test-automation.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

trivago announced a free PHPUnit code sprint at its Düsseldorf office on October 13-14, 2017. The event was intended to bring developers together to improve PHPUnit through feature work, bug fixes, documentation, and tests, with Sebastian Bergmann participating.

### Source excerpt

trivago will host a PHPUnit Code Sprint in mid-October to support this crucial part of the PHP ecosystem. Sebastian Bergmann, the creator of PHPUnit, will be there to coordinate the developers' efforts and to answer questions.

## Mocking Singleton PHP classes with PHPUnit

DevFeed: [Mocking Singleton PHP classes with PHPUnit](<https://devfeed.tech/articles/mocking-singleton-php-classes-with-phpunit-29143.md>)

Original publisher: [Read original article](<http://tech.zumba.com/2012/11/26/singleton-class-phpunit-mocking//>)

Author: Chris Saylor (christopher.saylor@zumba.com)

Published: 2012-11-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Zumba](<https://devfeed.tech/sources/zumba.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [PHPUnit](<https://devfeed.tech/topics/phpunit.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [mocking](<https://devfeed.tech/tags/mocking.md>), [php](<https://devfeed.tech/tags/php.md>), [phpunit](<https://devfeed.tech/tags/phpunit.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

A brief article about mocking singleton PHP classes with PHPUnit to support reusable testing.

### Source excerpt

Convenient way to mock singleton classes for easy, reusable testing.