When I execute the phpunit cases for one of the model, I'm getting the error below,

PHP Fatal error:  Class 'IntlDateFormatter' not found in /Users/userone/Sites/Magento-CE/vendor/phpunit/phpunit-mock-objects/src/Generator.php on line 1113

This is throwing an error even intl module is installed and extension=php_intl.dll is enabled in php.ini file.

When using \Magento\Framework\Stdlib\DateTime\TimezoneInterface as constructor argument I'm getting this issue.

How can I fix this error? Thanks in advance...

  • It seems that your PHP version and the intl extension version are not compatible. Please verify. – Mohit Kumar Arora Jun 18 '19 at 6:30
  • It looks like the PHP version 7.1.29 is compatible with PHPUnit 6.2.4. Any other idea on this? – TS Guhan Jun 18 '19 at 7:27
  • Please check the link phpunit.de/supported-versions.html for compatibility of phpunit with PHP 7.1. – Mohit Kumar Arora Jun 18 '19 at 8:00
  • I cross verified with the given link of php and phpunit version. It looks correct. I also checked the composer.json file where we have configured the phpunit version. Is there any other way to inject \Magento\Framework\Stdlib\DateTime\TimezoneInterface with another? – TS Guhan Jun 18 '19 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.