定制 fooman/magento2-phpunit-bridge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fooman/magento2-phpunit-bridge

最新稳定版本:v0.10.1

Composer 安装命令:

composer require fooman/magento2-phpunit-bridge

包简介

README 文档

README

https://github.com/Yoast/PHPUnit-Polyfills

How to Use

The aim is to be able to write phpunit tests for phpunit 9 and then be able to run these for Magento 2.4 and Magento 2.3 and 2.2 (more accurately their associated magento/framework versions and phpunit versions). Earlier versions bridged between phpunit 4 and 6.

Install with

composer require fooman/magento2-phpunit-bridge --dev

and then have your tests extend \Fooman\PhpunitBridge\BaseUnitTestCase:

<?php

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;

class MyClassToTest extends \Fooman\PhpunitBridge\BaseUnitTestCase
{

    public function setUp(): void
    {
        $objectManager = new ObjectManager($this);
    }

    public function testFunctionality()
    {
        $mock = $this->createMock(\Vendor\Module\MyClass::class);
    }
}

this will now work on Magento 2.3 as well without failures related to not using \PHPUnit_Framework_TestCase. 

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-12-31