Closed (fixed)
Project:
SimpleTest
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2008 at 08:31 UTC
Updated:
23 Jan 2008 at 17:32 UTC
Jump to comment: Most recent file
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | path_module.test_.txt | 4.76 KB | boombatower |
| #3 | path_module.test | 4.45 KB | chx |
Comments
Comment #1
chx commentedComment #2
aclight commentedThe GHOP task associated with this issue can be found at:
http://code.google.com/p/google-highly-open-participation-drupal/issues/...
Comment #3
chx commentedThis is the test from http://code.google.com/p/google-highly-open-participation-drupal/issues/... I have just copied over. That issue includes patches against path module, too.
Comment #4
chx commentedFirst of all thanks for the speedy work!
You need a drupalModuleEnable to make sure path module is on.
User input is not fed to
t()so remove please thet($node1->title)the t() calls. t is used only for constant strings not user input.You can safely presume that each randomname calls differ so no need for the getNewAlias function.
When checking for alias moves, I would assert the The path is already in use. message.
Core tests file go into the tests subdirectory of the simpletest module, no need for path_simpletest. Just upload the fixed test file.
Comment #5
Rok Žlender commentedTwo more things beside chxs' notes:
- I prefer using assertText function when you look for plain text on a page (title,body, anything that is visible), assertWantedRaw is used if you want to assert something in source code i.e. "Page simpletest_XRs4 has been updated."
- after you change the alias, you could also check that old alias produces "page not found" error
Comment #6
boombatower commentedSummary of changes:
drupalModuleEnable().t().getNewAlias().The path is already in use.andThe alias %alias is already in use in this language.instead of checking see if alias call would return that page._simpletest()hook.rawtests totext.A few notes:
page_creation.testas an example and it appears to use bothassertWantedRaw()andt()for the reason thatt()adds<em></em>around inserted variables. To implement the check for the message stating that the alias is already in use I have to do the same thing and thus have to leave aassertWantedRaw()in my test case.$this->assertWantedRaw(t('Your %post has been created.', array ('%post' => 'Page')), 'Page created');I believe this test case includes all the requested changes.
Comment #7
Rok Žlender commentedGreat work. You have made all the changes we asked for and I consider your task finished. I have two minor suggestions but this is really nitpicking
$this->assertTitle(new PatternExpectation('/Page not found/'), 'We get page not found error');I added this small changes to the test so you don't need to bother with them and also committed this test to cvs.
Comment #8
Rok Žlender commentedOh yeah I guess this is fixed now.
Regarding the hook confusion. You only need simpletest hook if you write tests for your own module (non core). Core tests are kept in simpletest module and are searched for in simpletest/tests dir. So any file that ends with ".test" in simpletest/tests is included automatically.
Comment #9
boombatower commentedThanks for clearing that up.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.