dev-master
9999999-dev
BSD-3-Clause
The Requires
- phpunit/phpunit ^4.1 | ^6.2
- magento/framework ^100.0 | ^101.0.0
v0.6.0
0.6.0.0
BSD-3-Clause
The Requires
- phpunit/phpunit ^4.1 | ^6.2
- magento/framework ^100.0 | ^101.0.0
Wallogit.com
2017 © Pedro Peláez
https://github.com/Yoast/PHPUnit-Polyfills, (*1)
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)
BSD-3-Clause
BSD-3-Clause