PHP code example of fooman / magento2-phpunit-bridge

1. Go to this page and download the library: Download fooman/magento2-phpunit-bridge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fooman / magento2-phpunit-bridge example snippets



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);
    }