PHPackages                             magetest/magento-phpunit-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. magetest/magento-phpunit-extension

AbandonedMagento-module[Testing &amp; Quality](/categories/testing)

magetest/magento-phpunit-extension
==================================

Magento PHPUnit extension, a lightweight module and library for testing Magento applications with PHPUnit

222.9k7[1 issues](https://github.com/MageTest/Mage-Test/issues)PHP

Since Mar 24Pushed 12y ago8 watchersCompare

[ Source](https://github.com/MageTest/Mage-Test)[ Packagist](https://packagist.org/packages/magetest/magento-phpunit-extension)[ RSS](/packages/magetest-magento-phpunit-extension/feed)WikiDiscussions develop Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

MageTest
========

[](#magetest)

[![Build Status](https://camo.githubusercontent.com/d87ed784621bcf46d5b8d29aa40638caf3baa88b3c3cb2ae50e6cd7fa231b97c/68747470733a2f2f7472617669732d63692e6f72672f4d616765546573742f4d6167652d546573742e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/MageTest/Mage-Test)

This module provides a patched version of Mage\_Core enabling you to inject testing dependencies at run time. Due to the functionality of the Varien\_Autoloader the local code pool is prioritised over the core. Meaning that any code duplicated from the Mage vendor namespace into the local code pool will be used over the core.

This allows you to build and run functional controller tests in the same way you would with a standard Zend Framework Application using [Zend Test](http://framework.zend.com/manual/en/zend.test.phpunit.html). This mocks the Request and Response objects to that you can query the Response within a suite of tests.

Requirements
------------

[](#requirements)

- PHPUnit 3.5+
- PHP 5.3+

Installation
------------

[](#installation)

### Install using composer

[](#install-using-composer)

The simplest way to install Mage-Test is to use magento-composer-installer. First, add Mage-Test to the list of dependencies inside your store's `composer.json`, or create this file if it doesn't exist. You will also need to add some setup for magento-composer-installer, if you are not using it already. By convention this guide assumes this file exists at the root of your store's directory structure.

Inside your project's composer.json ensure your have at least the following contents.

```
{
    "require-dev": {
        "MageTest/Mage-Test": "*"
    },
    "repositories": [
	    {
	        "type": "composer",
	        "url": "http://packages.firegento.com"
	    }
    ],
    "extra":{
        "magento-root-dir": "./"
    },
    "config": {
        "bin-dir": "shell"
    },
    "autoload": {
        "psr-0": {
            "": [
                "app",
                "app/code/local",
                "app/code/community",
                "app/code/core",
                "lib"
            ]
        }
    },
    "minimum-stability": "dev"
}
```

Now to install everything, simply let composer do its job.

```
$ composer install --dev
```

Afterwards your magento project's directory structure should look something like the following.

```
./
├── LICENSE.html
├── LICENSE.txt
├── LICENSE_AFL.txt
├── RELEASE_NOTES.txt
├── api.php
├── app
├── composer.json
├── composer.lock
├── cron.php
├── cron.sh
├── dev
├── downloader
├── errors
├── favicon.ico
├── get.php
├── includes
├── index.php
├── index.php.sample
├── install.php
├── js
├── lib
├── mage
├── media
├── php.ini.sample
├── pkginfo
├── shell
├── skin
├── tests
├── var
└── vendor

```

You can verify the installation by running Mage-Test's own bundled test suite.

```
$ phpunit -c vendor/MageTest/Mage-Test/tests/phpunit.xml.dist
```

You can read more about Composer on its [official webpage](http://getcomposer.org). To find out more about Magento Composer Installer see its [Github project page](https://github.com/magento-hackathon/magento-composer-installer), or take a look at [Vinai Kopp's](http://twitter.com/VinaiKopp) [MageBase](http://www.magebase.com) [Composer with Magento article](http://magebase.com/magento-tutorials/composer-with-magento/).

### Install using Modman

[](#install-using-modman)

Mage-Test comes bundled with a [modman](https://github.com/colinmollenhour/modman) mapping file. To install with Modman, if you haven't already, run `modman init` followed by `modman clone https://github.com/MageTest/Mage-Test`

Modman maintains a detailed [wiki](https://github.com/colinmollenhour/modman/wiki/) with a Modman tutorial and further information on its use.

Usage
-----

[](#usage)

Feature Requests
----------------

[](#feature-requests)

If you have an idea of how to make this a better project or add functionality that would be of use the community then please [submit a feature request](https://github.com/MageTest/Mage-Test/issues). Create a new ticket and add the label of 'Feature'.

Contributing
------------

[](#contributing)

Developer IRC channel for MageTest is #magetest on Freenode.

1. [Fork it](https://github.com/MageTest/Mage-Test/fork_select)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Add tests for your new feature or bug fix.
4. Add your Feature or Fix to satisfy the tests.
5. Commit your changes (`git commit -am 'Added some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create a new Pull Request

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/155929?v=4)[Aaron Bonner](/maintainers/ajbonner)[@ajbonner](https://github.com/ajbonner)

![](https://www.gravatar.com/avatar/2ea89ef3cfddb9fd7bf53f673ea348c6a73058583322251c05a3886b3418fe02?d=identicon)[MageTest](/maintainers/MageTest)

![](https://www.gravatar.com/avatar/833ede60aeef40fb51a3c8302c89ea13e5f0189e7155982043edab1edc091b54?d=identicon)[alistairstead](/maintainers/alistairstead)

---

Top Contributors

[![ajbonner](https://avatars.githubusercontent.com/u/155929?v=4)](https://github.com/ajbonner "ajbonner (12 commits)")[![alistairstead](https://avatars.githubusercontent.com/u/62936?v=4)](https://github.com/alistairstead "alistairstead (4 commits)")[![MarcelloDuarte](https://avatars.githubusercontent.com/u/144535?v=4)](https://github.com/MarcelloDuarte "MarcelloDuarte (4 commits)")[![Vinai](https://avatars.githubusercontent.com/u/72463?v=4)](https://github.com/Vinai "Vinai (3 commits)")

### Embed Badge

![Health badge](/badges/magetest-magento-phpunit-extension/health.svg)

```
[![Health](https://phpackages.com/badges/magetest-magento-phpunit-extension/health.svg)](https://phpackages.com/packages/magetest-magento-phpunit-extension)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M341](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
