Commit Graph

8 Commits

Author SHA1 Message Date
oleibman
5dd7e883c6
Fix Issue 1441 (isDateTime and Formulas) (#1480)
* Fix Issue 1441 (isDateTime and Formulas)

When you have a date-field which is a formula, isDateTime returns false.
https://github.com/PHPOffice/PhpSpreadsheet/issues/1441

Report makes sense; fixed as suggested. Also fixed a few minor
related issues, and added tests so that Shared/Date and Shared/TimeZone
are now completely covered.

Date/setDefaultTimeZone and TimeZone/setTimeZone were not consistent
about what to do in event of failure - return false or throw.
They will now both return false, which is what Date's function
said it would do in its doc block anyhow. Date/validateTimeZone will
continue to throw; it was protected, but was never called outside
Date, so I changed it to private.

TimeZone/getTimeZoneAdjustment checked for 'UST' when it probably
meant 'UTC', and, as it turns out, the check is not even needed.

The most serious problem was that TimeZone/validateTimeZone does not
check the backwards-compatible time zones. The timezone project
aggressively, and very controversially, "demotes" timezones;
such timezones eventually wind up in the PHP backwards-compatible list.
We want to make sure to check that list so that our applications do not
break when this happens.
2020-05-24 20:02:39 +02:00
Adrien Crivelli
fcd9f10663
Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Gabriel Caruso
aed27a0bed Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase (#271)
Use the `PHPUnit\Framework\TestCase` notation instead of `PHPUnit_Framework_TestCase` while extending our TestCases. This will help us migrate to PHPUnit 6, that [no longer support snake case class names](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-6.0.md#changed-1).
2017-11-09 00:48:01 +09:00
Adrien Crivelli
aef4d711f5
Use self::assert*() instead of $this->assert*()
Because even if it doesn't make a difference in practice, it is
technically more correct to call static methods statically. It
also better advertise that those methods can be used from any context.
2017-09-22 14:22:44 +09:00
Zharikov Viktor
07455d24f6
Make global usage of use instead of FQCN
Closes #78
Closes #147
2017-05-18 00:10:16 +02:00
Adrien Crivelli
47cde0dadc
Introduce vendor prefix PhpOffice to namespace 2016-09-01 02:20:47 +09:00
Adrien Crivelli
f917b3b1f4
Avoid call_user_func() whenever possible 2016-08-26 15:39:29 +09:00
Adrien Crivelli
29bdbd4e0b
Respect PSR-0 with matching folder name and namespace PhpSpreadsheetTests 2016-08-25 13:53:15 +09:00