Closed (outdated)
Project:
SimpleTest
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Oct 2010 at 13:09 UTC
Updated:
11 Nov 2019 at 15:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
boombatower commentedI am not clear on what is going on, could you attempt to clarify the issue. Sorry, if I am missing something obvious.
Thanks.
Comment #2
dasjohi,
well as i explain above, i run a test on a multilingual site.
when executing clickLink within the test, it will open a corrupted URL, having the language-code double as "http://example.com/de/de/xyz".
outside the test, the clicked links work without any problem, so i guess that simpletest somehow causes the language system to inject the language code twice!?
i know this is hard to debug, but i really would like to see if this can be fixed...
thanks josef
Comment #3
dasjothe same happens to me with this->drupalPost :(
any help would be appreciated
Comment #4
dasjoComment #5
dasjoComment #6
dasjothe problem seems to happen with the "path prefix with language fallback" option only
steps to reproduce:
* install drupal 6 + cck + i18n
* enable content + content translation + simpletest
* activate translation for page content type
* languages - add german, language negociation is "path prefix with language fallback"
* activate translation for page content type
* add "my page" in english and translate it to "meine seite" in german (node/2 and node/3 in my case)
* execute the following simpletest
so here are the simpletest results:
$this->drupalGet('node/1'); worked, ok, but then...
we see that with $this->clickLink('Deutsch'); wrong url is generated. after the domain name worktest, we have "/en/de/node/2" which means, that there is both an english + a german language code. therefore we encounter a 404 error and the test fails...
with language negotiation set to "none", the test will just work:
assigning this to the i18n queue now.
if you could provide me a hint how to avoid this issue, i would like to submit a patch
Comment #7
dasjoComment #8
dasjodebugging this->drupalLogin(...);
in drupal_web_test_case.php
...
$path = "/en/user";
call getAbsoluteUrl($path);
...
$path = url($path, $options);
now, $path is "/en/en/user"
not sure yet, how to avoid this?
Comment #9
dasjoboombatower told me, that this problem is caused by simpletests url handling / the browser it uses.
the http://drupal.org/project/browser should help us overcome this for the future (incomplete d7 draft exists at the moment)
in order to address my specific issue with the language code being put twice in the url i wrote the following patch
Comment #10
klausiwe use spaces instead of tabs
Powered by Dreditor.
Comment #11
dasjoyeah tanks, hope this one's better :)
Comment #12
dasjoComment #13
dave reidI think your problem here is in your test case, the function tearDown() needs to call
parent::tearDown().Comment #14
dasjo@dave reid: thanks for the hint for teatDown(), but this doesn't affect the issue / the behaviour of links being executed within the test.
Comment #15
kenorb commentedTested and it works.
There is also the case, when links to the files are wrong, like: /en/files/simpletest/verbose/Index-1.html
but probably it's a different issue.
I've reported it here: #1844500: Path to files are prefixed with 'en' (en/files)
These two were working correctly in the previous versions (before back-porting from D7)
Comment #17
kenorb commentedComment #18
lendudeThis version is not supported anymore.