Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed test with latest PHP versions #291

Closed
remicollet opened this issue Jul 21, 2016 · 2 comments
Closed

Failed test with latest PHP versions #291

remicollet opened this issue Jul 21, 2016 · 2 comments

Comments

@remicollet
Copy link
Contributor

Discovered in Fedora QA: https://apps.fedoraproject.org/koschei/package/php-justinrainbow-json-schema?collection=f25

Since update from 7.0.9RC1 to 7.0.9 (which should not break anything, as only security fix)

1) JsonSchema\Tests\Constraints\FormatTest::testInvalidFormat with data set #10 ('-1', 'utc-millisec')
Expected 1 error
Failed asserting that 0 matches expected 1.

/dev/shm/BUILD/json-schema-6b2a33e6a768f96bdc2ead5600af0822eed17d67/tests/Constraints/FormatTest.php:66

Also fails with PHP 5.6.24
V1 also fails (same error)

@remicollet
Copy link
Contributor Author

Additional info:

$ php54 -r 'var_dump(DateTime::createFromFormat("U", -1));'
bool(false)

$ php55 -r 'var_dump(DateTime::createFromFormat("U", -1));'
bool(false)

$ php56 -r 'var_dump(DateTime::createFromFormat("U", -1));'
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "1969-12-31 23:59:59.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}

$ php70 -r 'var_dump(DateTime::createFromFormat("U", -1));'
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "1969-12-31 23:59:59.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}

$ php71 -r 'var_dump(DateTime::createFromFormat("U", -1));'
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "1969-12-31 23:59:59.000000"
  ["timezone_type"]=>
  int(1)
  ["timezone"]=>
  string(6) "+00:00"
}

@derickr
Copy link

derickr commented Jul 21, 2016

This is a bug fix, where "U" now also understand negative timestamps. -1 gets converted to "-1".

bighappyface added a commit that referenced this issue Jul 25, 2016
Fix #291 failed tests with lestest PHP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants