Question

I have a zf2 application running on my WAMP server. And i have PHPUnit 4.0.18 by Sebastian Bergmann running too.

My problem is :

        echo $this->dateFormat(
               $MyVariable->getDateInvoice(),
                \IntlDateFormatter::LONG, // date
                \IntlDateFormatter::SHORT, // time
                $this->navigation()->getTranslator()->getLocale()
            );

Works in browser, depends on locale. Works perfectly. Means that IntlDateFormatter class is found right ?

But, when i run PhpUnit from line commande with

phpunit

i got this error and sure, my build is failing :

 Fatal error:  Class 'IntlDateFormatter' not found in ...(myproject path)

Why PHPunit can't find this class and how fix this ?

PS : my intl extension on wamp (php.ini) is enabled this is my configuration of intl module from phpinfo()

Internationalization support    enabled
version 1.1.0
ICU version 49.1.2
ICU Data version    49.1.2
Était-ce utile?

La solution

You should check that the php.ini file used in CLI has the extension enabled.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top