Run module unit test

run all

../../phpunit/phpunit/phpunit –colors -c ‘../../../dev/tests/unit/phpunit.xml.dist’ ./Test/Unit

copied dev/tests/unit/phpunit.xml.dist to dev/tests/unit/phpunit.xml and used the following configuration:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi=""
    <testsuite name="Magento Unit Tests">
        <directory suffix="Test.php">../../../vendor/vendorname/m2-module-name/Test/Unit</directory>
        <ini name="date.timezone" value="America/Los_Angeles"/>
        <ini name="xdebug.max_nesting_level" value="200"/>

Then I ran the phpunit command:

vendor/bin/phpunit -c dev/tests/unit/phpunit.xml --coverage-html ./report vendor/vendorname/m2-module-name/

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s