• This repository has been archived on 27/May/2023
  • Stars
    star
    299
  • Rank 139,269 (Top 3 %)
  • Language
    PHP
  • License
    Open Software Lic...
  • Created over 13 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Magento PHPUnit Integration

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

  • PHP 5.3 or higher
  • PHPUnit 3.7.x
  • Magento CE1.4.x-1.7.x/PE1.9.x-PE1.10.x/EE1.9.x-1.12.x

Build Status

  • Latest Release: Master Branch
  • Development Branch: Development Branch

Documentation

Also you may follow our related blogposts.

Installation

  1. There are two ways of obtaining the extension:

    modman 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

    # Shell scripts needs to be run from this directory
    cd $YOUR_MAGENTO_DIRECTORY/shell 
    # Specify your test database name and base url for controller tests
    php 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

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

More Repositories

1

magento2-product-preloader

Magento 2 product data preloaded for anticipated data in other components based on currently available product objects.
PHP
107
star
2

EcomDev_LayoutCompiler

Layout Compiler for Magento
PHP
85
star
3

MageCI

[ABADONED] Magento Continuous Integration Tools
Shell
77
star
4

EcomDev_UrlRewrite

Alternative implementation of Url Rewrite Index by EcomDev
PHP
72
star
5

EcomDev_Varnish

Advanced Varnish implementation for Magento
PHP
63
star
6

sync-magento-2-migration

Release of rough proof of concept from 2018 that allows to import and export millions of products quickly
PHP
53
star
7

mage-os-database-changelog

Connects to MySQL as a replication service and aggregates updates into database tables into easy to use event aggregates
Rust
40
star
8

checkitout

Magento CheckItOut! extension, the checkout framework for Magento 1.x
PHP
35
star
9

fast-hypernode

Fast Byte Hypernode Box (Uses unison plugin for file shares)
Shell
31
star
10

SUPEE6788-PerformanceFix

Fix for SUPEE6788 performance bottleneck
PHP
24
star
11

EcomDev_ProductPageShipping

The extension is NOT SUPPORTED anymore. I advice use Webshopapps alternative instead.
PHP
22
star
12

php-mysql-binary-protocol

Implementation of MySQL binary protocol for socket interactions in pure PHP
15
star
13

magento-psr6-bridge

Magento 2.0 PSR-6 Adapter. Allows you to leverage all the cool libraries that require PSR-6
PHP
14
star
14

example-preloading-configurable-product

Example of Pre-Loader Implementation for Magento 2
PHP
10
star
15

cache-key

Cache key generator library, useful for not worrying about your cache key structure at all, library does all the magic for you
PHP
10
star
16

awesome-layered-navigation

Awesome Magento2 Layered Navigation
9
star
17

mysql-performance-benchmark

PHP
9
star
18

magento-migrations

Magento 2.0 Migrations module
PHP
9
star
19

magento2-test-essentials

Test essentials for writing testable code that interacts with Magento core modules
PHP
9
star
20

compiler

Compiler of parseable data structures from (XML, JSON, etc) into PHP code that can be included into application
PHP
8
star
21

magento2-compilation

Drop-In Replacement for setup:di:compile with better compilation performance and hyper-efficient runtime
8
star
22

EcomDev_ComposerAutoload

Extension that allows using of composer components inside of your project.
PHP
8
star
23

magento-translation-tool

A tool to generate Magento translation files from php code and xml files
8
star
24

chef-magento_varnish

Installs varnish as adopted to Magento version
VCL
7
star
25

phpspec-magento-di-adapter

This small PHPSpec extension allows you to test Magento 2.0 modules much more easier by utilizing generators of Magento\Framework\ObjectManager.
PHP
7
star
26

chef-magento

Chef Magento cookbook
Ruby
7
star
27

magento-custom-store-code

Magento 1.x Custom Store Code Extension
PHP
5
star
28

csrf-cookie-token-generator

HTTP server written in rust that generates CSRF token on request and stores it in cookie
Rust
5
star
29

chef-php_fpm

Chef cookbook for installing php-fpm
Ruby
3
star
30

examples

http://examples.ecomdev.org/
JavaScript
3
star
31

chef-vhost

Various vhost creation recipe
Ruby
3
star
32

cross-domain-session-manager

ReactPHP based session cross domain session manager
PHP
2
star
33

vagrant_magento2_nginx

Magento 2 Nginx Vagrant Box
Ruby
2
star
34

mage-os-indexer

Mage-OS improved indexer (base components)
PHP
2
star
35

composed-mutagen-hypernode-elastic

Hypernode with Elastic Search, Blackfire and Mutagen
Dockerfile
2
star
36

cache-warmer

Asycn Socket API based for pre-warming cache for varnish
2
star
37

chef-ecomdev_common

EcomDev Chef Cookbook Commons
Ruby
1
star
38

phpspec-file-matcher

PHPSpec File Matcher
PHP
1
star
39

rust-mysql-proxy

MySQL connection proxy with simplified protocol to connect from any language that does not have async mysql connection pool
Rust
1
star
40

performance-training

Performance training environment
Makefile
1
star
41

magento2-indexer-adapter

Magento 2 Common Testable Indexer Adapters
PHP
1
star
42

color

Color tools for Image Processing
PHP
1
star
43

reactive-socket

Abstraction for reactive application that rely on socket servers and clients
PHP
1
star