phpunit - Correctly setting date.timezone on Windows 7 for PHP 5.4.35 binary only install -


i writing unit tests series of php classes in netbeans (testing phpunit).

these classes rely on nusoap script don't want mock.

when run tests rely on nusoap dependency, seemingly common "it not safe rely on system's timezone" error method in nusoap script:

function getmicrotime() {         if (function_exists('gettimeofday')) {             $tod = gettimeofday();             $sec = $tod['sec'];             $usec = $tod['usec'];         } else {             $sec = time();             $usec = 0;         }         return strftime('%y-%m-%d %h:%m:%s', $sec) . '.' . sprintf('%06d', $usec);     } 

so, have gone php.ini file , added:

[date]   ; defines default timezone used date functions ;  ; http://php.net/date.timezone  date.timezone = "america/new_york" 

i using php binaries. there no web instance there 1 ini file modify, far know.

when rerun these tests errors phpunit right away , no tests run. if remove edit ini file tests run normally. "normally" defined tests return failure same timezone error

many of other answers around web suggest editing ini file in 2 places, 1 web , 1 cli. however, since have 1 ini file, not sure else need modify in order time zone correctly recognized.

how, on windows 7 machine php 5.4.35 binaries installed (no iis @ all), make work? i've tried adding date_default_timezone_set( 'america/new_york' ); nusoap script, seemingly had no effect.

thanks.

this red herring, , tough 1 find too.

i went basics , dug around in php.ini file , discovered using test/prod version, decided try development version.

running tests in both netbeans , cli, able see "real" root cause, related class testing. there's no information @ displayed user unless configured in php.ini.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -