Skip to content

Fixes the calendar in constructor to handle null #19751

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

Merged
merged 1 commit into from
Aug 27, 2016
Merged

Conversation

wakqasahmed
Copy link
Contributor

@wakqasahmed wakqasahmed commented Aug 26, 2016

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #19688
License MIT
Doc PR none

Fix the calendar exception to handle null, error was raised while exporting from akeneo

The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $calendar value NULL behavior is not implemented. Only the GREGORIAN calendar is supported. Please install the "intl" extension for full localization capabilities.

https://cloud.githubusercontent.com/assets/4486133/17287404/81f951cc-57e0-11e6-9f6f-e231bbf00bf4.png

@wakqasahmed
Copy link
Contributor Author

wakqasahmed commented Aug 26, 2016

@nicolas-grekas

Test Details:

BEFORE
————
$ php ./phpunit --filter testConstructorWithoutCalendar IntlDateFormatterTest src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php
PHPUnit 5.1.7 by Sebastian Bergmann and contributors.

Testing Symfony\Component\Intl\Tests\DateFormatter\IntlDateFormatterTest
E 1 / 1 (100%)

Time: 49 ms, Memory: 4.50MB

There was 1 error:

  1. Symfony\Component\Intl\Tests\DateFormatter\IntlDateFormatterTest::testConstructorWithoutCalendar
    Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException: The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $calendar value NULL behavior is not implemented. Only the GREGORIAN calendar is supported. Please install the "intl" extension for full localization capabilities.

/Users/waqasahmed/Desktop/symfony-2.7/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php:153
/Users/waqasahmed/Desktop/symfony-2.7/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php:33

FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
KO src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php

AFTER
———

$ php ./phpunit --filter testConstructorWithoutCalendar IntlDateFormatterTest src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php
PHPUnit 5.1.7 by Sebastian Bergmann and contributors.

Testing Symfony\Component\Intl\Tests\DateFormatter\IntlDateFormatterTest
. 1 / 1 (100%)

Time: 45 ms, Memory: 4.25MB

OK (1 test, 1 assertion)
OK src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php

@Tobion
Copy link
Contributor

Tobion commented Aug 27, 2016

LGTM 👍 as it's in line with http://php.net/manual/en/intldateformatter.create.php

@HeahDude
Copy link
Contributor

👍

Status: reviewed

@fabpot
Copy link
Member

fabpot commented Aug 27, 2016

Thank you @wakqasahmed.

@fabpot fabpot merged commit 43f2672 into symfony:2.7 Aug 27, 2016
fabpot added a commit that referenced this pull request Aug 27, 2016
…med)

This PR was merged into the 2.7 branch.

Discussion
----------

Fixes the calendar in constructor to handle null

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19688
| License       | MIT
| Doc PR        | none

Fix the calendar exception to handle null, error was raised while exporting from akeneo

The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $calendar value NULL behavior is not implemented. Only the GREGORIAN calendar is supported. Please install the "intl" extension for full localization capabilities.

https://cloud.githubusercontent.com/assets/4486133/17287404/81f951cc-57e0-11e6-9f6f-e231bbf00bf4.png

Commits
-------

43f2672 Fixes the calendar in constructor to handle null
This was referenced Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants