Currently I am able to run the Unit test from the below command
C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\bin>phpunit -c
../../core/phpunit.xml.dist ../../modules/custom/lse_demo/tests/src/Unit
PHPUnit 6.5.0 by Sebastian Bergmann and contributors.
...... 6 / 6
(100%)
Time: 10.62 seconds, Memory: 6.00MB
OK (6 tests, 12 assertions)
But When I tried to do the same with Kernel test I get below error
C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\bin>phpunit -c ../../core/phpunit.xml.dist ../../modules/custom/lse_demo/tests/src/Kernel
PHPUnit 6.5.0 by Sebastian Bergmann and contributors.
EEEEEE 6 / 6 (100%)
Time: 11.43 seconds, Memory: 6.00MB
There were 6 errors:
1) Drupal\Tests\lse_demo\Kernel\DefaultControllerKernelTest::testDefaultController with data set #0 ('work', 'User', 'Welcome User to Work')
PHPUnit\Framework\Exception: PHP Fatal error: Uncaught PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist".
thrown in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189
Fatal error: Uncaught PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist".
thrown in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189
PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist". in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189
C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\>./vendor/bin/phpunit -c core/phpunit.xml.dist modules/custom/lse_demo/tests/src/Kernel
<env name="SIMPLETEST_BASE_URL" value="http://drupaleightsix.dd:8083/"/> <env name="SIMPLETEST_DB" value="mysql://drupaluser@localhost/drupaleightsix"/>
And ran the below command, Now I am getting below errorG:\Acquia dev desktop\LocalInstance\drupal_eight_six>vendor\bin\phpunit modules/custom/lse_demo/tests/src/Kernel PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
Could you please help me to configure phpunit.xml.dist ?mysql://username:password@localhost/databasename#table_prefix
machine actively refused it
means that the service is either not running or runs on different port or network interface. Check that you have MySQL running on 127.0.0.1 and uses 3306 port (default).