# 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.