承接 bkubicki/magento2-unit-tests-doubles 相关项目开发

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

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

bkubicki/magento2-unit-tests-doubles

Composer 安装命令:

composer require bkubicki/magento2-unit-tests-doubles

包简介

Unit tests doubles for Magento 2

关键字:

README 文档

README

Overview

Library provides useful doubles of different kinds for unit testing of Magento 2.3+. Some of the doubles can be created using dedicated builders, which helps in configuring desired behavior of doubles. By using these doubles you can get rid of over-mocking in unit tests and time spent on writing unit should decrease. It can be achieved because all doubles inherits or implements replaced object or interface, so type consistency is preserved. Examples in here.

Prerequisites

  • PHP ^7.4

Installation

To install the extension use the following commands:

 composer require bkubicki/magento2-unit-tests-doubles

Tests

Unit

Run command

composer test-unit-coverage

which is an alias for

./vendor/bin/phpunit -c phpunit.xml --testsuite "Unit" --coverage-html coverage/coverage-html --colors=always

Integration

Run command

composer test-integration

which is an alias for

./vendor/bin/phpunit -c phpunit.xml --testsuite "Integration" --colors=always

Mutation tests (using Infection)

  1. Infection tests requires xDebug enabled.

  2. Run command

    composer test-infection
    

    which does the following:

    • Run PHPUnit tests and generate coverage in xml:
      ./vendor/bin/phpunit -c phpunit.xml --testsuite "Unit" --coverage-xml coverage/coverage-xml --log-junit coverage/phpunit.junit.xml
      
    • Run Infection mutation tests for covered code
      ./vendor/bin/infection --coverage=coverage --only-covered --show-mutations
      
  3. Find detailed report from mutations in var/log/dev/infection.log.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Changelog

See changelog here.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固