2
Fatal error: Class 'Magento\TestFramework\Helper\Bootstrap' not found in /var/www/html/magento2/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php on line 17

above error are display in integration test for module. How to solve this error?

2 Answers 2

2

Check that you run an integration test with a phpunit config file for integration tests: <magento2_root>/dev/tests/integration/phpunit.xml.dist

This is an example how you can run your test from command line: /var/www/html/magento2/vendor/phpunit/phpunit/phpunit -c /var/www/html/magento2/dev/tests/integration/phpunit.xml.dist /var/www/html/magento2/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php

Also look how to Run tests for a specific module in Magento2

7
  • phpunit.xml.dist file is already there, but when call specific file they display error.
    – user32787
    Dec 17, 2015 at 12:27
  • Could you show your command line? Dec 17, 2015 at 12:30
  • be sure that your phpunit.xml.dist is from /var/www/html/magento2/dev/tests/integration/ Dec 17, 2015 at 12:40
  • yes,file is on that location,My command line is, /var/www/html/magento2/vendor/phpunit/phpunit$ php phpunit /var/www/html/magento2/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php
    – user32787
    Dec 17, 2015 at 12:56
  • I cannot find usage of /var/www/html/magento2/dev/tests/integration/phpunit.xml.dist in the given command. So phpunit will try to use config file from current directory. Do you run from /var/www/html/magento2/dev/tests/integration ? If no try to define explicitly config file. Dec 17, 2015 at 13:01
0

I have the same problem now, how did it going? is it can be solved following the answer?

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.