Comments

Posted by Pádraic Brady (padraic) on 2009-11-17T09:06:55.000+0000

Just to confirm, there are all Date related?

All the dates are handled at a distance by Zend_Date which is where they are parsed and re-formatted. From the test results, the input value is being correctly received (Atom and RSS use different date standards), but the output formatting (via Zend_Date) is malformed. There's no custom date handling, or other code capable of change, outside of that.

Locale shouldn't be an issue. The only part of Zend_Date of relevance in the tests is parsing an ISO or RFC standard date, and outputting the same information using the test-defined format (just a long string description). The step used simply ensures all dates are resolved to the same format in method results.

I'll do some testing on my side when I have PHP5.3 machine in front of me. While many tests are failing, it's obviously one single behaviour so fixing it should, with luck, be a simple matter.

Posted by Thomas Weidner (thomas) on 2009-11-18T03:08:41.000+0000

Detaching Zend_Date from affected components as this is a Zend_Feed unittest error

Posted by Thomas Weidner (thomas) on 2009-11-18T03:15:07.000+0000

Just as hint:
Looks like the used format for Zend_Date has been set to "GNU" instead of "ISO". It's an static option.

You should ensure in your unittests to set the options for Zend_Date while doing the test setup.
This could happen due to previous run code, or through other unit tests run previously.

Posted by Thomas Weidner (thomas) on 2009-11-18T03:16:21.000+0000

Just as hint:
Looks like the used format for Zend_Date has been set to "GNU" instead of "ISO". It's an static option.

You should ensure in your unittests to set the options for Zend_Date while doing the test setup.
This could happen due to previous run code, or through other unit tests run previously.

Posted by Pádraic Brady (padraic) on 2009-11-18T03:54:35.000+0000

Thanks for the hint Thomas - I'll see if that makes a difference, and clean up the setup/teardown to account for any static options I might be missing.

Posted by Pádraic Brady (padraic) on 2009-11-18T05:21:51.000+0000

Just to clarify a slight oversight on my part (I'll clarify this in the docs later too) - Zend_Feed_Reader does not attempt to output a normalised date from Zend_Date. It simply returns the Zend_Date object itself from all date methods, which allows the user to define output formatting and such on their own terms. Neither does Zend_Feed_Reader tamper with any Zend_Date options. Therefore, the formatting bug is a bug within the Tests where output is required to verify the correct date was parsed from the output. This was probably not the best approach to begin with - comparing two Zend_Date objects would have worked without needing explicit output - so my bad ;). The actual component itself should function perfectly as a result - this is an error in the tests, not the component.

The docs will clarify the treatment/use of Zend_Date by adding a note indicating that the returned Zend_Date follows the statically set options, and that users should take this into account when getting a date string.

As a result, I'm recategorising this issue as a "Unit Tests: Problem" issue. I'm working on a fix to the unit tests now to ensure the correct options are set during setup, and the originals swapped back during teardown. If the options are an issue, it won't be hard to replicate by fudging the options a bit to find which one is responsible. During tomorrow I'll implement an output independent version of the same tests to simplify it more.

Posted by Pádraic Brady (padraic) on 2009-11-18T05:45:02.000+0000

I confirmed the cause is Zend_Date having a format_type option set to "php" instead of "iso". Someone else's tests are leaking settings. I'll try to find the offending tests - presumably something higher up the list.

Benjamin - can you confirm if running Zend_Feed tests by themselves pass correctly?

Posted by Pádraic Brady (padraic) on 2009-11-18T06:06:04.000+0000

Committed r19017 to trunk (merged to release-1.9 branch) which locks all Zend_Feed_Reader tests using Zend_Date into ISO formatting. The original settings are restored during teardown. This should ensure PHP formatting of dates cannot be leaked from other test suites (as seems to be the current case).

The reporter can confirm the fix is applicable - the issue won't be formally closed until Benjamin confirms.

Posted by Pádraic Brady (padraic) on 2009-11-20T12:34:41.000+0000

Fixed in trunk and release branch - the tests with issues are now rewritten to avoid string comparisons depending on a default locale. OP can confirm and reopen if any other locale issues to be aware of.