I'm currently writing tests for one of my modules, and I've run into a bit of a problem. When I run a test that uses $this->drupalPost('node/add/page', $edit, t('Save')); to post a node add form, that portion of the test fails, and when I take a look at the verbose message I find it's a memory limit error that causes the failure. I increased my php memory limit to 512 and see it in Drupal as 512 but I still receive the same result. Posting a node form is vital to the test, so I need to figure out how I can fix this. Does anyone know of anything that can be causing this?
I'm fairly new to working with Simpletest (but I've definitely realized how absolutely wonderful it is!), so I don't know if I'm missing something.
Thanks for your time. : )
Comments
Can't help you with the
Can't help you with the memory thing, but
You post a node with the submit button called "Page was added." ?
function $this->drupalPost($path, $edit,$submit, array $options = array(), array $headers = array())This function does a post request on a Drupal page.
$pathindicates a page containing a form that will be filled with$editdata.$optionswill be passed tourl()to build the URL from$path$submitwill be clicked (submit caption will be translated by this method).$headerscan be added to the POST operation$editdata should be an array where each index is the value of the "name" attribute of the HTML form element. Use something like Firebug to inspect the HTML to get this value.(http://drupal.org/node/265762)
You maybe wanted to do an assert? http://drupal.org/node/265828
Oh, yeah that was a typo. Was
Oh, yeah that was a typo. Was tired last night and thinking too much about assertions after too many hours of writing them. I'll fix that. The node form is posting with no apparent errors, but the only issue is that it causes the memory limit error, which consequently ruins any assertions on the node page itself (since it seems to think the "memory limit exceeded" page is the node page).
For the actual code, see line
1338of this file. Maybe there is something I did wrong?