User tests: Successful: Unsuccessful:
Same as #2616 but for staging
There are several tests which fail on windows due to cross platform issues (line endings and directory separators).
Here's the tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32842&start=0
In case of line endings, where appropriate, I've changed the test to use \n
instead of PHP_EOL
.
In case of directory separators, JPath::clean()
will have already changed everything to DIRECTORY_SEPARATOR
by the time the test runs so, I've changed the test to also use that instead of /
.
In a case where we are just testing an xml string, I've changed the test itself to assertXmlStringEqualsXmlString
so that line ending issues are not even considered at all.
There are still some tests failing in JViewLegacyTest
but, in my opinion, these are actually problems with JViewLegacy
and not the test. Basically, it should be calling JPath::clean()
on directory strings but it isn't. So I will include those fixes in a different PR.
If we've got a hardcoded \n
then the test should be checking for \n
not PHP_EOL
.
Indeed. And \n
is what you want in these cases anyway. And also in all cases everywhere forever. Why should we send different line endings based on what OS the server is running?
Labels |
Added:
?
?
?
|
So I decided to do that JViewLegacy fix after all. Now all tests should run properly on windows or any system.
I found another case of PHP_EOL
in the tests but \n
in the library. I don't know if there is ever a case for using PHP_EOL
, seems like just a bad idea.
Since we require that files use unix line endings, I guess PHP_EOL
doesn't make much sense.
Yeah so, without this patch, the tests fail. How can anyone contribute code to this project if all code is required to pass the tests and the tests already don't pass?
I am having problems running the unit tests, posted it in the JC Tracker.
Title |
|
test: works. This fixes 4 tests on my windows machine. In my opinion, this can be merged.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-11 12:40:43 |
Looks good to me - although I'm confused as to why
\n
is a better alternative toPHP_EOL
which by definition should be cross platform compatible