Git Product home page Git Product logo

techdivision_magentounittesting's Introduction

PHPUnit based testsuite for Magento 1

This project aims to bring the core tests and the important parts of the Magento 2 testsuite to Magento 1.

Please refer to the blog post (German) for further information.

With the TechDivision_MagentoUnitTesting framework located at src/dev/tests/unit/framework is it possible to reach 100% unit test coverage for Magento 1.

How to use

Installation

Copy the whole content of the src directory to your Magento project.

composer install
cp -R src/* <YOUR_MAGENTO_ROOT_DIRECTORY>

Configuration

We recommend to create an own phpunit xml file if you want write tests only for your own module. You will find an example file (phpunit.xml.dev) in src/dev/tests/unit/ directory, which is a good beginning. That example xml also includes the html coverage report which is a must-have while writing your tests.

Execution

Execute your tests with the following command:

cd <YOUR_MAGENTO_ROOT_DIRECTORY>
php dev/tests/phpunit-3.7.37.phar -c dev/tests/unit/phpunit.xml.dev

Replace dev/tests/unit/phpunit.xml.dev with your own xml file, if you create one.

To display the coverage report browse the following url:

<YOUR-MAGENTO-HOST>/coverage/index.html

Writing tests

To use the framework you have to extend your test classes from TechDivision_MagentoUnitTesting_TestCase_Abstract or an other testcase class which is extended from the abstract class. All testcases are located at src/dev/tests/unit/framework/TechDivision/MagentoUnitTesting/TestCase

Documentation for testing framework

https://github.com/techdivision/TechDivision_MagentoUnitTesting/wiki

Feel free to open an issue.

techdivision_magentounittesting's People

Contributors

maderlock avatar stockbauerm avatar sydekumf avatar vadimjustus avatar vinai avatar wagnert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.