承接 magetest/manager 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

magetest/manager

Composer 安装命令:

composer require --dev magetest/manager

包简介

Magento fixture manager

README 文档

README

Build Status Scrutinizer Code Quality

Manager is a PHP library that manages test fixtures for a Magento site.

Fixtures

Manager takes YAML files as an input to create fixtures for a Magento test environment.

A YAML file maps to a Magento model via the key of the collection. The collection then maps to the model attributes of the defined Magento model.

Defining a model in a YAML file would look like this:

customer/customer:
    firstname: test
    lastname: test
    email: customer@example.com
    password: 123123pass
    website_id: 1
    store: 1
    status: 1

The most important part, is the key in the collection. This is the argument supplied to Mage::getModel(). After we define the fixture, all we need to do now is load it into the Manager.

<?php
use MageTest\Manager\FixtureManager,
    MageTest\Manager\Attributes\Provider\YamlProvider;

//init Manager and define attributes provider. Default is YAML
$manager = new FixtureManager(new YamlProvider());

//Load fixture by model type into manager
$manager->loadFixture('customer/customer');

//Use key defined in fixture file, to return instance of fixture model
$customer = $manager->getFixture('customer/customer');

//Use customer model, change values/behaviour, assert data for acceptance tests

//Delete all fixtures from Magento test environment DB
$manager->clear();

Usage

This library can be used in conjunction with Behat (or any other acceptance/functional testing tool of choice). The flow could look something like this:

  • Instantiate Manager before the scenario
  • Before a feature, load required model(s) for acceptance test
  • After the scenario, call clear() to clean up fixtures.

The aim is to keep the Step Defintions slim, and abstract away the DB interactions required to set up test data (think what Mink does as a web browser emulator abstraction).

Roadmap

  • Default model builder.
  • Add support for Configurable products, Bundled products
  • Handle multiple instances of the same fixture.
  • JSON, XML attribute providers.

Contributors

Authors: https://github.com/MageTest/Manager/contributors

统计信息

  • 总下载量: 44.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 14
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固