AOEpeople/EcomDev_PHPUnit

Name: EcomDev_PHPUnit

Owner: AOE

Description: Magento PHPUnit Integration

Created: 2014-03-06 13:06:55.0

Updated: 2017-04-29 23:16:37.0

Pushed: 2015-07-02 20:02:23.0

Homepage: http://www.ecomdev.org/shop/code-testing/php-unit-test-suite.html

Size: 794

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

EcomDev

Magento PHPUnit Integration

Magento is a quite complex platform without built in unit test suite, so the code is not oriented on running tests over it.

This extension was created especially for resolving this problem and promoting test driven development practices in Magento developers community. It doesn't change core files or brake your Magento instalment database, because all the system objects are replaced during the run-time with the test ones and a separate database connection is used for tests.

System Requirements
Build Status
Documentation

Also you may follow our related blogposts.

Installation
  1. There are two ways of obtaining the extension:

    • Use Module Manager

      an clone git://github.com/EcomDev/EcomDev_PHPUnit.git 
      
    • Add extension as dependency in your composer.json to install it from Magento Composer Repository

      
      "require": {
         "ecomdev/ecomdev_phpunit": "*"
      }
      
      
  2. Open your terminal and navigate to your magento directory for performing the following command, they are required to configure system for running the test suite

    ell scripts needs to be run from this directory
    YOUR_MAGENTO_DIRECTORY/shell 
    ecify your test database name and base url for controller tests
    ecomdev-phpunit.php -a magento-config --db-name $DB_NAME --base-url http://your.magento.url/
    

    If you receive a warning on PHPUnit checks for optional packages, run the following command

    ecomdev-phpunit.php -a fix-autoloader
    
  3. Run the unit tests first time for installing test database. It will take about 3 minutes.

    $ phpunit 
    
  4. If it shows that there was no tests found, it means that extension was successfully installed. If it shows some errors, then it means, that your customizations has install scripts that relay on your current database data and you should fix them. Or use your dev database as a base for the tests, but prior first time running the suite.

Issue Tracker

We use github issue tracker only for contributions management. If you want to post an issue please use our Issue Tracker

Contributions

If you want to take a part in improving our extension please create branches based on dev one.

Create your contribution branch:
$ git checkout -b [your-name]/[feature] dev

Then submit them for pull request.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.