Unit testing is the programatic testing of individual units of code.
0
votes
1answer
30 views
DrupalWebTestCase::drupalLogin() doesn't work if the Domain access module is enabled
DrupalWebTestCase::drupalLogin() doesn't work when the Domain access module is enabled.
It seems the issues is with Drupal sessions / the Domain access module. Is there any work-around for this?
0
votes
1answer
40 views
How do I run unit tests against datasets? (DrupalWebTestCase and DrupalTestCase)
I am testing a module that I am writing against the Unit Testing framework that comes with Drupal 7. All makes sense, and everything asserts as it should.
My question though, is it possible to run ...
3
votes
1answer
60 views
Should Features modules be unit tested?
When you write a module, you write unit tests (or you should - I don't because I am a bad person, but I want to change - honest).
Should modules generated with Features be unit tested where ...
2
votes
1answer
41 views
Why am I getting call to undefined function after splitting module functions to two files?
Now my module has two main files:
menu_perm.module
menu_perm.admin.inc
I added second file to .info:
files[] = menu_perm.admin.inc
I cleared the cache.
In my test class (PHPUnit) file I am ...
0
votes
3answers
150 views
About Drupal, “software testing” and “regression testing” with Drupal
My company has taken maintenance of a Drupal website where there are some modules that have been specifically developed for this site.
I have to answer to a question that most software do: how can we ...
0
votes
1answer
57 views
Using custom test helpers in your test cases
I'm trying to write test cases for my custom module and in order to speed things along for current and future testing I defined a garbage class that can spit out random data. However the testing ...
1
vote
3answers
341 views
Assign all permissions to a user programatically
Is there a way to assign all the permissions to an authenticated user through code, I want to do it in unit tests.
3
votes
1answer
243 views
How to SimpleTest a module's use of drupal_alter() or module_invoke_all()?
I'm developing a custom module. My module calls drupal_alter() with a $type unique to my module, so other modules can alter the behavior of my module.
I'd like to write a SimpleTest for my module, ...
3
votes
2answers
1k views
How to load module include files in .test file?
I'm trying to update the Drupal 7 version of the password_policy.test file that is included with the Password Policy module. When I run the tests, I'm getting "Fatal error: Call to undefined function ...
3
votes
1answer
59 views
Get currently active 'simpletest' user during test
How do you retrieve the current 'simpletest' user during a simpletest.
During a simpletest is the $user GLOBAL from the test environment or the live environment?
0
votes
2answers
191 views
How to create a user with custom profile fields for a SimpleTest
How can I programmatically create a new user for use during a SimpleTest? The user must have certain custom fields populated during the registration.
I'm using $this->drupalPost('user/register', ...
0
votes
1answer
248 views
Showing test coverage of simpletests
I'm looking to start using simpletest (or possibly go to pressflow) to test some Drupal modules I am working on.
I would like to get some information about the code that is covered by these tests. I ...
2
votes
1answer
157 views
Unit test for custom content type
I created my custom content type 'Proposal' in D7 and used field API to attach fields.
In order to write unit test for it using "simpletest" (core module), do I need to setup my proposal content type ...
5
votes
2answers
260 views
How to do (unit) testing of Drupal specific JavaScript code?
For PHP code in custom module, we use SimpleTest. But how do you test the JavaScript code in a module or a theme?
I known about JavaScript testing frameworks like Jasmine or QUnit, but I'm curious to ...