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="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
         colors="true"
         bootstrap="./framework/bootstrap.php"
        >
    <testsuite name="Magento Unit Tests">
        <directory suffix="Test.php">../../../vendor/vendorname/m2-module-name/Test/Unit</directory>
    </testsuite>
    <php>
        <ini name="date.timezone" value="America/Los_Angeles"/>
        <ini name="xdebug.max_nesting_level" value="200"/>
    </php>
</phpunit>

Then I ran the phpunit command:

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s