Comments (2)
Current master's tests fail on my local machine (PHP 8.1.4):
There were 3 failures:
1) strftimeTest::testTimeFormats
%X: Preferred time representation based on locale, without the date
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'1:02:03 PM'
+'13:02:03'
/home/andi/www/devel/strftime/tests/strftimeTest.php:132
2) strftimeTest::testStampsFormats
%c: Preferred date and time stamp based on locale
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'March 6, 2022 at 1:02 PM'
+'March 6, 2022 at 13:02'
/home/andi/www/devel/strftime/tests/strftimeTest.php:143
3) strftimeTest::testLocale
%c: Preferred date and time stamp based on locale
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2022(e)ko martxoaren 6(a) 13:02'
+'2022(e)ko martxoakren 6(a) 13:02'
/home/andi/www/devel/strftime/tests/strftimeTest.php:177
Is that a known issue? Are the tests somehow dependent on the locale setup of my machine?
from strftime.
Is an bug in the test setUp:
public function setUp () : void {
setlocale(LC_TIME, 'en');
date_default_timezone_set('Europe/Madrid');
}
In my experience there are differences in the values supported by the php setlocale function.
It was a mistake on my part to trust that setlocale(LC_TIME, 'en') would work in all environments.
I've removed the setlocale from setUp and used the locale option of the strftime function with the string 'en-EN', hopefully that's more universal.
from strftime.
Related Issues (9)
- PSR-12 compability? HOT 2
- doesn't work with LC_TIME=nb_NO.UTF8 ? HOT 13
- "Stand-alone" versions of "month in year" and "day of week" formats more closely mimic strftime in German locale HOT 1
- Replace "is_int" check with "is_numeric"? HOT 2
- PHP fatal error "Call to undefined method IntlCalendar::setGregorianChange()" with non-Gregorian locales
- Minimum PHP version in composer.json is incorrect HOT 2
- 24-hour format of an hour (0 to 23) HOT 8
- Behaves differently from stock `strftime` for the Italian default year format HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strftime.