2017 © Pedro Peláez
 

library magento2-phpunit-bridge

image

fooman/magento2-phpunit-bridge

  • Sunday, July 22, 2018
  • by fooman
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 400 % Grown

The README.md

Use this instead

https://github.com/Yoast/PHPUnit-Polyfills, (*1)

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., (*2)

Install with, (*3)

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

and then have your tests extend \Fooman\PhpunitBridge\BaseUnitTestCase:, (*4)

``` <?php, (*5)

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;, (*6)

class MyClassToTest extends \Fooman\PhpunitBridge\BaseUnitTestCase {, (*7)

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

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

}, (*8)

this will now work on Magento 2.3 as well without failures related to not using \PHPUnit_Framework_TestCase., (*9)

The Versions

22/07 2018

dev-master

9999999-dev

  Sources   Download

BSD-3-Clause

The Requires

 

22/07 2018

v0.6.0

0.6.0.0

  Sources   Download

BSD-3-Clause

The Requires

 

21/07 2018

v0.5.2

0.5.2.0

  Sources   Download

BSD-3-Clause

10/07 2018

v0.5.0

0.5.0.0

  Sources   Download

BSD-3-Clause

10/07 2018

v0.5.1

0.5.1.0

  Sources   Download

BSD-3-Clause