문제

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
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top