SimpleTest is Drupal's custom testing framework.

learn more… | top users | synonyms

0
votes
0answers
7 views

Views not working with Simpletest

I have just started using the Simpletest module for Drupal 7. I am trying to use the drupalGet function to pull a URL. The URL is a views module URL. I am able to pull other pages using the ...
1
vote
0answers
18 views

How to non-destructively test file-detection functionality

I am writing tests for a module that is dependant on an external library, located in: sites/all/libraries/mylib I have written a hook_requirements to check for the presence of this library and ...
0
votes
0answers
15 views

I've a problem trying to create users with roles

I'm using simpletest_clone to do my tests. what i want now is just to create an user for every existing role i've created (I dont need just the list of permissions, i need the user to have the exact ...
0
votes
2answers
36 views

Getting image SRC with xpath - Simpletest (WebTestBase) [closed]

I am developing a Drupal 8 test which will check for a image's existence. The image will not be loaded while running the test and I want to catch that using xpath(). The HTML I am trying to search ...
2
votes
1answer
26 views

Ways to speed up a simpletest?

I'm trying to speed up my test. I have to use simpletest_clone. I've read something like "copy the database to memory" but i did some research and didn't found how. Aaand if i want to do more than ...
1
vote
2answers
30 views

Is there a way to load the content types using DrupalWebTestCase?

I'm trying to learn how to do testing in Drupal. I'm pretty new with it so maybe i didn't got it right. well, I'm trying to test some views of content types, but to test those views i need to have ...
2
votes
1answer
45 views

Check for double escaped string - Simpletest

I am trying to create a test case against a patch which will be used for automated testing in D8 release. However, I am trying to do it to check if the page I am on it, has any multiple escaped HTML ...
2
votes
1answer
33 views

What's the best practice way to test block Views with SImpleTest?

I've created a block view, which I've positioned on the page using the admin UI. I've exported my view using Features and fe_block for its block. I'd like to write a SimpleTest to verify that ...
0
votes
1answer
23 views

Always expanded menu items not showing up expanded in custom menu

I have a custom menu profile-menu and have configured a block to display that menu. It has four menu items with 'expanded' => TRUE. However, during test runs these expanded menu items do not show ...
0
votes
1answer
24 views

Simpletest: database exception during setUp

I'm writing lots and lots of test cases for different modules and have come across a rather strange error about which I'm hoping others may have more insight. In my setUp function override, the first ...
0
votes
0answers
10 views

SimpleTestClone access to the real $conf array

So for a caching module im trying to write some simpletests using simpletest clone module, and i want to have access to the variables i set in settings.php like: $conf['cache_class_cache_form'] = ...
0
votes
0answers
14 views

Simpletestcase not loading the file or coming the admin module interface

I added a patch for a feature request to add an admin link to simple module redirect module. Initially I added the patch, but it was failing because testcases was not added. ...
0
votes
1answer
34 views

Custom simpltest does not run successfully

I have written an automated test to create a node of a specific content type. Here is the code: class GlueTestingBuySystemTestCase extends DrupalWebTestCase { protected $privileged_user; ...
0
votes
1answer
74 views

Test doesn't show up [closed]

I have created a test orb.test for my module and placed it within the module directory. Installed the Simple Test module. When I visit the /admin/config/development/testing my test orb.test its not ...
2
votes
2answers
60 views

How do I post a node that has its created field set to the past in a test class?

I am creating a test class using the framework of the core Testing module for a module that is supposed to autoexpire nodes some time after they've been created. Nodes have two timestamp fields: ...
-1
votes
1answer
23 views

Why are no tests shown on testing overview? [closed]

I want to run DrupalWebTestCases on my custom Drupal 7 module. Following the Tutorial at https://drupal.org/simpletest-tutorial-drupal7 i'm stuck at running the tests: also after cache deletion no ...
0
votes
0answers
38 views

How do I speed up `drush test-run` (compared to the SimpleTest UI)?

I have a number of Feature modules for which I've written tests to assure they work as expected. For performance reasons, I've overridden the parent's setUp() method in each test case so that it ...
0
votes
0answers
26 views

Why does DrupalWebTestCase (SimpleTest) encode multiple select options with indices?

Summary: I've written a module that uses the Form API. When multiple form select options are POSTed using my web browser, they get encoded (by the browser) like this: option[]=Value A option[]=Value ...
0
votes
0answers
23 views

Order of tests in test group

Is there a way to set order of tests (or weights) in test group. I'm referring Sipmletest. Something like: static public function getInfo() { return array( 'name' => 'test name', ...
2
votes
0answers
49 views

Running simpletest tests with clean urls on nginx

Having Drupal 7 on nginx with enabled clean urls. nginx config: location @drupal { rewrite ^/(.*)$ /index.php?q=$1 last; } When trying to run tests getting message: You are not authorized to ...
2
votes
1answer
85 views

Which test cases/tests should I run?

I'm a bit confused about best practices for testing in Drupal 7. When I'm going to deploy, should I run the entire test suite—including all Drupal core tests—every time? This seems like a bit of ...
0
votes
1answer
37 views

Core Testing vs SimpleTest

I have a query concerning the core Testing module and the SimpleTest module. When I install a new site, the Testing module is available but disabled. When enabled, a list of tests are available for a ...
1
vote
1answer
99 views

How do I enable a features module in the setup of a simpletest testcase

I'm trying to test some permissions that are related to custom node types and Organic Groups that I've built and packaged as a feature using the features module. I'm trying to enable the feature (and ...
0
votes
0answers
116 views

Simpletest failed to set field problem

I'm stuck with this problem. I have a form with 3 select fields: year_level, section, subject. The year_level field has a select event that calls ajax to populate the section options (and the subject ...
3
votes
2answers
986 views

Simpletest on select field loaded by ajax

I have searched through Google and haven't found an answer. Stack Exchange is my last resort. In my form, I have two select fields: $form['system']['foo'] = array( ... '#type' => 'select', ...
0
votes
0answers
45 views

Simpletest and examples module

I've enabled SimpleTest module and simpletest_example module in the Examples module I've cleared all caches and i do not see anything about simpletest_example in this page : ...
1
vote
1answer
22 views

How do I block a user/cancel a user account in Simpletest?

I'm trying to write some tests for a module for situations in which a user is blocked. I know I can use drupalCreateUser() to make new users, but how do I block a user I have created in Simpletest?
3
votes
1answer
35 views

Why are comments enabled on my content types in Simpletests?

When I run Simpletest, it's showing comment forms at the bottom of all the nodes, even though I don't even have the comment module enabled, nor permissions assigned for it. These comment forms showing ...
2
votes
0answers
74 views

How to test AJAX Callback with simpletest on Drupal 6

I know there is drupalPostAJAX() available on Drupal 7 to do this, but I want to use it on Drupal 6. So I found on this link : http://tiger-fish.com/blog/drupal-6-posting-ajax-callbacks-simpletest a ...
0
votes
1answer
79 views

How to SAVE a webform in Simpletest?

I am able to save a sample webform in Simpletest if I only use title and body: $edit = array(); $edit['title'] = 'Sample webform'; $edit["body[$langcode][0][value]"] = $this->randomName(); ...
1
vote
1answer
63 views

EFQ propertyCondition Doesn't work in Simpletest

This Entity Field Query works as expected outside of simpletest: $query->entityCondition('entity_type', 'node') ->fieldCondition('field_exhibition_window_start', 'value', $date, '<=') ...
1
vote
0answers
24 views

How to reuse custom methods in a simpletest class?

I have created several test methods that I find useful in a lot of other situations. All I need is to define an include file of higher visibility which contains an utility class which is autoloaded ...
0
votes
1answer
226 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 ...
1
vote
2answers
70 views

What is the most robust way to assert for a validation error?

I want to test the validation function in my custom module, and so I've written a simpletest that inputs an illegal value in a field and then attempts to save the node. Currently I'm using ...
1
vote
0answers
47 views

Press 'continue' button in simpletest

I am trying to enable modules via POSTing to /admin/modules in a simpletest. It works fine, except that there are dependencies (the whole reason I want to do it this way) and when it requires then ...
0
votes
2answers
277 views

Simpletest fails to create the field_config table

I'm only just getting into TDD with Drupal and unfortunately run into trouble right away. For some reason the simpletest####field_config table isn't being created, and I don't get why; many other ...
3
votes
1answer
332 views

Why do PAreview/codesniffer gripe about missing “scope modifier”?

I am writing a simpletest file for my Drupal module. It works OK, but when I use PAreview (automatic tool based upon PHP codesniffer to check correctness of Drupal code), I get the following error ...
0
votes
1answer
295 views

Impossible to enable modules in SimpleTest

I am building SimpleTests for my modules: It seems like the standard procedure for enabling modules it doesn't work for me: function setUp() { parent::setUp('mymodule'); } I constantly get a ...
6
votes
1answer
227 views

webTestCase->drupalPost() or drupal_http_request()?

I'm writing a simpletest for a module that posts XML directly to a URL (it's on a closed system so there's no user or auth or anything at this point). I've manually tested getting the response code ...
1
vote
1answer
105 views

drupal 7 entity and simple test

What I can't workout is what steps I need to see if the entity is loaded using simple test. Any direction will be greatly appreciated thanks. /** * @file * Definition of creation of a entity. */ ...
0
votes
1answer
35 views

testing a function

I have setup a file called mymodule.test and in the module I have file called mymodule.inc. Every is working but I am unsure about the following. Below is mymodule.test file. class MyModule extends ...
0
votes
2answers
204 views

Drupal registry table not populated with test class files

I tried to write tests for custom modules and I found that registry database table is not populated with .test files and thus admin/config/development/testing displays only one SimpleTest test. I ...
0
votes
1answer
94 views

Why is my alias “NULL” in a test?

I am using Drupal 7, I have Pathauto enabled, and my user has permissions to create new aliases. When I manually create a node, uncheck the checkbox for automatic alias generation, and enter a custom ...
2
votes
1answer
85 views

Version numbers of dependencies in testing

If I'm submitting a test to the qa.drupal.org testbot, and my module requires a dev version of another module in order to function properly, is it adequate to declare the version in my module's .info ...
0
votes
1answer
114 views

Creating custom node aliases inside a simpletest

I am attempting to write simpletests to replicate the steps to reproduce on this d.o issue. I need to create a test node with a custom alias, as if I had unchecked the "Generate automatic URL alias" ...
0
votes
1answer
172 views

Is there a clean-URL-reflective version of file_create_url()?

I have a site with clean URLs enabled and in a test I've written, I compare the current drupalGetHeader('location') to file_create_url($file->uri). The tests passes on my site, but on the ...
0
votes
1answer
77 views

Does DrupalWebTestCase::drupalGet() use the permissions of DrupalWebTestCase::$loggedInUser?

I'm trying to test the permissions of a particular role, and this code: $this->drupalLogin($this->editor_user); $this->drupalGet($node->path['source']); returns a 200 (OK) status, when ...
2
votes
1answer
95 views

Programmatically save altered file

As I mentioned in my previous question I'm attempting to write tests for a patch that will, ideally, trigger the creation of a redirect if the URI of a file changes. My patch uses hook_file_update() ...
4
votes
1answer
90 views

$file->original: Where does it come from?

I am attempting to write a patch for the Redirect module that automatically creates a redirect from the old file path to the new one, whenever a file is updated. I added a hook to redirect.module: ...
3
votes
1answer
47 views

Checking if module has the right output on multilingual pages with simpletest_clone

I'm trying with simpletest_clone to check if my modules have the right output depending on the language. Now my problem is, that when I do the following Code: $this->drupalGet('de'); // check the ...